idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
161,200
@ Override public Map < String , List < AppConfigurationEntry > > getEntries ( ) { Map < String , List < AppConfigurationEntry > > jaasConfigurationEntries = new HashMap < String , List < AppConfigurationEntry > > ( ) ; Map < String , String > jaasConfigIDs = new HashMap < String , String > ( ) ; if ( jaasLoginContextEntries != null ) { createJAASClientLoginContextEntry ( jaasConfigurationEntries ) ; Iterator < JAASLoginContextEntry > lcEntries = jaasLoginContextEntries . getServices ( ) ; while ( lcEntries . hasNext ( ) ) { JAASLoginContextEntry loginContextEntry = lcEntries . next ( ) ; String entryName = loginContextEntry . getEntryName ( ) ; List < JAASLoginModuleConfig > loginModules = loginContextEntry . getLoginModules ( ) ; if ( JaasLoginConfigConstants . SYSTEM_DEFAULT . equalsIgnoreCase ( entryName ) ) { ensureProxyIsNotSpecifyInSystemDefaultEntry ( entryName , loginModules ) ; } List < AppConfigurationEntry > appConfEntry = getLoginModules ( loginModules ) ; if ( appConfEntry != null && ! appConfEntry . isEmpty ( ) ) { if ( jaasConfigIDs . containsKey ( entryName ) ) { // if there is a duplicate name, log a warning message to indicate which id is being overwritten. String id = jaasConfigIDs . get ( entryName ) ; Tr . warning ( tc , "JAAS_LOGIN_CONTEXT_ENTRY_HAS_DUPLICATE_NAME" , new Object [ ] { entryName , id , loginContextEntry . getId ( ) } ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "configure jaasContextLoginEntry id: " + loginContextEntry . getId ( ) ) ; Tr . debug ( tc , "configure jaasContextLoginEntry: " + entryName + " has " + appConfEntry . size ( ) + " loginModule(s)" ) ; Tr . debug ( tc , "appConfEntry: " + appConfEntry ) ; } jaasConfigurationEntries . put ( entryName , appConfEntry ) ; jaasConfigIDs . put ( entryName , loginContextEntry . getId ( ) ) ; } } } return jaasConfigurationEntries ; }
Get all jaasLoginContextEntry in the server . xml and create any missing default entries . If there are no jaas configuration then create all the default entries system . DEFAULT system . WEB_INBOUND system . DESERIALIZE_CONTEXT system . UNAUTHENTICATED and WSLogin
538
66
161,201
@ Override @ Trivial public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { if ( "addTransformer" . equals ( method . getName ( ) ) ) { addTransformer ( ( ClassFileTransformer ) args [ 0 ] , args . length > 1 ? ( Boolean ) args [ 1 ] : false ) ; return null ; } if ( "removeTransformer" . equals ( method . getName ( ) ) ) { return removeTransformer ( ( ClassFileTransformer ) args [ 0 ] ) ; } if ( "appendToBootstrapClassLoaderSearch" . equals ( method . getName ( ) ) ) { appendToBootstrapClassLoaderSearch ( ( JarFile ) args [ 0 ] ) ; return null ; } if ( "appendToSystemClassLoaderSearch" . equals ( method . getName ( ) ) ) { appendToSystemClassLoaderSearch ( ( JarFile ) args [ 0 ] ) ; return null ; } if ( "setNativeMethodPrefix" . equals ( method . getName ( ) ) ) { setNativeMethodPrefix ( ( ClassFileTransformer ) args [ 0 ] , ( String ) args [ 1 ] ) ; return null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , method . getName ( ) , args ) ; } Object retValue = method . invoke ( instrumentation , args ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { if ( void . class == method . getReturnType ( ) ) { Tr . exit ( tc , method . getName ( ) ) ; } else { Tr . exit ( tc , method . getName ( ) , retValue ) ; } } return retValue ; }
If this method is traced it can call proxy . toString which causes another invoke call leading to an infinite loop .
388
23
161,202
public static void addSubjectCustomData ( Subject callSubject , Hashtable < String , Object > newCred ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "addSubjectCustomData" , newCred ) ; } AddPrivateCredentials action = new AddPrivateCredentials ( callSubject , newCred ) ; AccessController . doPrivileged ( action ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addSubjectCustomData" ) ; } }
This method adds the custom Hashtable provided to the private credentials of the Subject passed in .
135
18
161,203
public static Hashtable < String , Object > getCustomCredentials ( Subject callSubject , String cacheKey ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getCustomCredentials" , cacheKey ) ; } if ( callSubject == null || cacheKey == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getCustomCredentials" , " null" ) ; } return null ; } GetCustomCredentials action = new GetCustomCredentials ( callSubject , cacheKey ) ; Hashtable < String , Object > cred = ( Hashtable < String , Object > ) AccessController . doPrivileged ( action ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getCustomCredentials" , objectId ( cred ) ) ; } return cred ; }
This method extracts the custom hashtable from the provided Subject using the cacheKey .
221
16
161,204
public static void handlePasswordValidationCallback ( PasswordValidationCallback callback , Subject executionSubject , Hashtable < String , Object > addedCred , String appRealm , Invocation [ ] invocations ) throws RemoteException , WSSecurityException { invocations [ 2 ] = Invocation . PASSWORDVALIDATIONCALLBACK ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "handlePasswordValidationCallback" , new Object [ ] { objectId ( callback ) , callback . getUsername ( ) } ) ; } Subject callSubject = callback . getSubject ( ) ; if ( ! executionSubject . equals ( callSubject ) ) { Tr . warning ( tc , "EXECUTION_CALLBACK_SUBJECT_MISMATCH_J2CA0673" , new Object [ ] { "PasswordValidationCallback" } ) ; callSubject = executionSubject ; } try { // 673415 String userName = callback . getUsername ( ) ; String password = null ; if ( callback . getPassword ( ) != null ) { password = new String ( callback . getPassword ( ) ) ; } if ( callSubject != null ) { GetRegistry action = new GetRegistry ( appRealm ) ; UserRegistry registry = AccessController . doPrivileged ( action ) ; if ( checkUserPassword ( userName , password , registry , appRealm , addedCred , invocations [ 0 ] ) ) { callback . setResult ( true ) ; } else { callback . setResult ( false ) ; addedCred . clear ( ) ; // 673415 } } } catch ( PrivilegedActionException pae ) { // End 673415 callback . setResult ( false ) ; addedCred . clear ( ) ; Exception ex = pae . getException ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "handlePasswordValidationCallback" , callback . getResult ( ) ) ; } if ( ex instanceof WSSecurityException ) { throw ( WSSecurityException ) ex ; } else { // This means an unexpected runtime exception is wrapped in the PrivilegedActionException throw new WSSecurityException ( ex ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "handlePasswordValidationCallback" , callback . getResult ( ) ) ; } }
The PasswordValidationCallback is used for password validation . This callback is used by the Resource Adapter to employ the password validation facilities of its containing runtime . This Callback is passed to the CallbackHandler provided by the J2C runtime during invocation of the handle method by the Resource Adapter .
540
58
161,205
private static void addUniqueIdAndGroupsForUser ( String securityName , Hashtable < String , Object > credData , String appRealm ) // 675924 throws WSSecurityException , RemoteException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "addUniqueIdAndGroupsForUser" , securityName ) ; } GetRegistry action = new GetRegistry ( appRealm ) ; UserRegistry registry = null ; try { registry = AccessController . doPrivileged ( action ) ; } catch ( PrivilegedActionException pae ) { Exception ex = pae . getException ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addUniqueIdAndGroupsForUser" ) ; } if ( ex instanceof WSSecurityException ) { throw ( WSSecurityException ) ex ; } else { // This means an unexpected runtime exception is wrapped in the PrivilegedActionException throw new WSSecurityException ( ex ) ; } } if ( registry . isValidUser ( securityName ) ) { String uniqueId = registry . getUniqueUserId ( securityName ) ; String uidGrp = stripRealm ( uniqueId , appRealm ) ; // 669627 // 673415 List < ? > groups = null ; try { groups = registry . getUniqueGroupIds ( uidGrp ) ; // 673415 } catch ( EntryNotFoundException ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception is " , ex ) ; Tr . warning ( tc , "NO_GROUPS_FOR_UNIQUEID_J2CA0679" , uidGrp ) ; // 673415 } updateCustomHashtable ( credData , appRealm , uniqueId , securityName , groups ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Added uniqueId: " + uniqueId + " and uniqueGroups: " + groups ) ; } else { String message = getNLS ( ) . getFormattedMessage ( "INVALID_USER_NAME_IN_PRINCIPAL_J2CA0670" , new Object [ ] { securityName } , "J2CA0670E: The WorkManager was unable to establish the security context for the Work instance, " + "because the resource adapter provided a caller identity " + securityName + ", which does not belong to the security " + "domain associated with the application." ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addUniqueIdAndGroupsForUser" ) ; } throw new WSSecurityException ( message ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addUniqueIdAndGroupsForUser" ) ; } }
Checks if the provided securityName is valid against the user registry . In case it is valid it then gets uniqueId and the groups for the user with the given securityName . It then uses this information to create the custom hashtable required for login .
679
51
161,206
private static boolean checkUserPassword ( String userSecurityName , String password , UserRegistry registry , String realmName , Hashtable < String , Object > addedCred , Invocation isCCInvoked ) { // 675924 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "checkUserPassword user: " + userSecurityName + ", realm: " + realmName ) ; } if ( userSecurityName == null || password == null ) { Tr . error ( tc , "INVALID_USERNAME_PASSWORD_INBOUND_J2CA0674" , userSecurityName ) ; // 673415 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , new Object [ ] { userSecurityName , password } ) ; } return false ; // 675924 } boolean match = validateCallbackInformation ( addedCred , userSecurityName , isCCInvoked ) ; // 675924 if ( ! match ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - invalid username and password." ) ; } return false ; // 675924 } try { registry . checkPassword ( userSecurityName , password ) ; String uniqueId = registry . getUniqueUserId ( userSecurityName ) ; uniqueId = stripRealm ( uniqueId , realmName ) ; // 669627 List < String > uniqueGroups = new ArrayList < String > ( ) ; List < ? > groupNames = registry . getGroupsForUser ( userSecurityName ) ; if ( groupNames != null ) for ( Object group : groupNames ) { uniqueGroups . add ( registry . getUniqueGroupId ( ( String ) group ) ) ; } updateCustomHashtable ( addedCred , realmName , uniqueId , userSecurityName , uniqueGroups ) ; } catch ( PasswordCheckFailedException e ) { // This error is thrown when there is no entry corresponding to the username and password // in the registry. Tr . error ( tc , "INVALID_USERNAME_PASSWORD_INBOUND_J2CA0674" , userSecurityName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - invalid username and password" ) ; // 675924 } return false ; // 675924 } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ejs.j2c.work.security.J2CSecurityHelper.checkUserPassword" , "%C" ) ; Tr . error ( tc , "VALIDATION_FAILED_INBOUND_J2CA0684" , userSecurityName ) ; // 675924 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - unable to validate password." ) ; } return false ; // 675924 } // End 673415 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "checkUserPassword" , " - password is valid." ) ; } return true ; }
Checks the user name and password against the user registry provided . If the user name and password are valid it returns true .
742
25
161,207
public static String getCacheKey ( String uniqueId , String appRealm ) { StringBuilder cacheKey = new StringBuilder ( ) ; if ( uniqueId == null || appRealm == null ) { cacheKey . append ( CACHE_KEY_PREFIX ) ; } else { cacheKey . append ( CACHE_KEY_PREFIX ) . append ( uniqueId ) . append ( CACHE_KEY_SEPARATOR ) . append ( appRealm ) ; } return cacheKey . toString ( ) ; }
This method constructs the cache key that is required by security for caching the Subject .
114
16
161,208
private static boolean validateCallbackInformation ( Hashtable < String , Object > credData , String securityName , Invocation isInvoked ) { boolean status = true ; if ( isInvoked == Invocation . CALLERPRINCIPALCALLBACK ) { String existingName = ( String ) credData . get ( AttributeNameConstants . WSCREDENTIAL_SECURITYNAME ) ; if ( existingName != null && ! ( existingName . equals ( securityName ) ) ) { status = false ; Tr . error ( tc , "CALLBACK_SECURITY_NAME_MISMATCH_J2CA0675" , new Object [ ] { securityName , existingName } ) ; } } return status ; }
This method validates whether the user security name provided by the CallerPrincipalCallback and the PasswordValidationCallback match . It does this check only in case the CallerPrincipalCallback was invoked prior to the current invocation of the PasswordValidationCallback .
154
50
161,209
public static String objectId ( Object o ) { return ( o == null ) ? "0x0" : o . getClass ( ) . getName ( ) + "@" + Integer . toHexString ( o . hashCode ( ) ) ; }
A string that identifies an object instance within WAS messages and heap dumps .
54
14
161,210
synchronized void activate ( ComponentContext componentContext ) throws Exception { this . componentContext = componentContext ; this . classAvailableTransformer = new ClassAvailableTransformer ( this , instrumentation , includeBootstrap ) ; this . transformer = new ProbeClassFileTransformer ( this , instrumentation , includeBootstrap ) ; this . proxyActivator = new MonitoringProxyActivator ( componentContext . getBundleContext ( ) , this , this . instrumentation ) ; this . proxyActivator . activate ( ) ; // The class available transformer is registered as retransform incapable // to avoid having to keep track of which classes have been updated with // static initializers and serialVersionUID fields. The probe transformer // however, must run through the listener config every time a retransform // occurs to allow it to discover new probes and replace currently active // probes //RTCD 89497-Update the set with the classes for ( Class < ? > clazz : MonitoringUtility . loadMonitoringClasses ( componentContext . getBundleContext ( ) . getBundle ( ) ) ) { for ( int i = 0 ; i < clazz . getMethods ( ) . length ; i ++ ) { Annotation anno = ( ( clazz . getMethods ( ) [ i ] ) . getAnnotation ( ProbeSite . class ) ) ; if ( anno != null ) { String temp = ( ( ProbeSite ) anno ) . clazz ( ) ; probeMonitorSet . add ( temp ) ; } } } //Update to the set ended. //RTC D89497 adding instrumentors moved below as the MonitoringUtility.loadMonitoringClasses //was resulting in loading classes and in turn getting called during with transform process which //might cause hang in some situations this . instrumentation . addTransformer ( this . transformer , true ) ; this . instrumentation . addTransformer ( this . classAvailableTransformer ) ; // We're active so if we have any listeners, we can run down the loaded // classes. for ( Class < ? > clazz : this . instrumentation . getAllLoadedClasses ( ) ) { classAvailable ( clazz ) ; } }
Activation callback from the Declarative Services runtime where the component is ready for activation .
453
18
161,211
synchronized void deactivate ( ) throws Exception { this . proxyActivator . deactivate ( ) ; this . instrumentation . removeTransformer ( this . classAvailableTransformer ) ; this . instrumentation . removeTransformer ( this . transformer ) ; this . shuttingDown = true ; // Save the classes that have listeners so we can retransform Collection < Class < ? > > probedClasses = processRemovedListeners ( allRegisteredListeners ) ; // Clear all data structures listenersLock . writeLock ( ) . lock ( ) ; try { listenersForMonitor . clear ( ) ; allRegisteredListeners . clear ( ) ; } finally { listenersLock . writeLock ( ) . unlock ( ) ; } activeProbesById . clear ( ) ; listenersByProbe . clear ( ) ; listenersByClass . clear ( ) ; probesByKey . clear ( ) ; probesByListener . clear ( ) ; this . proxyActivator = null ; this . transformer = null ; this . componentContext = null ; // Retransform the probed classes without our transformers in play if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "deactivate: probedClasses.size() = " + probedClasses . size ( ) ) ; } for ( Class < ? > clazz : probedClasses ) { instrumentation . retransformClasses ( clazz ) ; } this . instrumentation = null ; }
Deactivation callback from the Declarative Services runtime where the component is deactivated .
317
17
161,212
@ Override public boolean registerMonitor ( Object monitor ) { // Process the annotated object, build a configuration, and create probe // listeners that represent each call site of the monitor. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "monitor = " + monitor ) ; } long startTime = System . nanoTime ( ) ; Set < ProbeListener > listeners = buildListenersFromAnnotated ( monitor ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "buildListenersFromAnnotated time = " + TimeUnit . NANOSECONDS . toMicros ( System . nanoTime ( ) - startTime ) + "usec" ) ; } // Update collections of listeners startTime = System . nanoTime ( ) ; if ( ! addListenersForMonitor ( monitor , listeners ) ) { return false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "addListenersForMonitorTime = " + TimeUnit . NANOSECONDS . toMicros ( System . nanoTime ( ) - startTime ) + "usec" ) ; } // Process all of the listeners and determine which of the available // classes needs to be transformed startTime = System . nanoTime ( ) ; Collection < Class < ? > > effectedClasses = processNewListeners ( listeners ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "processNewListeners time = " + TimeUnit . NANOSECONDS . toMicros ( System . nanoTime ( ) - startTime ) + "usec" ) ; } // Update the classes with the configured probes if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "effectedClasses.size() = " + effectedClasses . size ( ) ) ; } startTime = System . nanoTime ( ) ; this . transformer . instrumentWithProbes ( effectedClasses ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "instrumentWithProbes time = " + TimeUnit . NANOSECONDS . toMicros ( System . nanoTime ( ) - startTime ) + "usec" ) ; } return true ; }
Register an annotated object as a monitor . The annotations will be used to generate the appropriate configuration .
562
20
161,213
@ Override public boolean unregisterMonitor ( Object annotatedObject ) { // Clear the listener data if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "unregisteringMonitor = " + annotatedObject ) ; } Set < ProbeListener > listeners = removeListenersForMonitor ( annotatedObject ) ; if ( listeners == null ) { return false ; } // Remove the listeners associated with the inactive monitor and // find out which classes need to be transformed to remove stale probes Collection < Class < ? > > effectedClasses = processRemovedListeners ( listeners ) ; // Update the classes to remove dead probes (optional) if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "effectedClasses.size() = " + effectedClasses . size ( ) ) ; } this . transformer . instrumentWithProbes ( effectedClasses ) ; Set set = moduleInstanceToBundleMap . entrySet ( ) ; Iterator i = set . iterator ( ) ; while ( i . hasNext ( ) ) { Map . Entry mapE = ( Map . Entry ) i . next ( ) ; if ( mapE != null && mapE . getValue ( ) . equals ( annotatedObject . getClass ( ) . getName ( ) ) ) { PmiAbstractModule s = ( PmiAbstractModule ) mapE . getKey ( ) ; s . unregister ( ) ; } } return true ; }
Unregister the specified monitor . Unregistering a monitor may cause one or more probes to be deactivated and the associated classes retransformed .
329
29
161,214
Set < ProbeListener > removeListenersForMonitor ( Object monitor ) { Set < ProbeListener > listeners = null ; listenersLock . writeLock ( ) . lock ( ) ; try { listeners = listenersForMonitor . remove ( monitor ) ; if ( listeners == null ) { listeners = Collections . emptySet ( ) ; } else { allRegisteredListeners . removeAll ( listeners ) ; } } finally { listenersLock . writeLock ( ) . unlock ( ) ; } return listeners ; }
Remove the listeners associated with the specified monitor from the set of registered listeners .
100
15
161,215
Collection < Class < ? > > processNewListeners ( Collection < ProbeListener > listeners ) { Set < Class < ? > > classesToTransform = new HashSet < Class < ? > > ( ) ; Set < ProbeListener > matchingListeners = new HashSet < ProbeListener > ( ) ; Set < Class < ? > > monitorableTemp ; synchronized ( this . monitorable ) { monitorableTemp = new HashSet < Class < ? > > ( this . monitorable ) ; } for ( Class < ? > clazz : monitorableTemp /* instrumentation.getAllLoadedClasses() */ ) { if ( ! isMonitorable ( clazz ) ) { continue ; } for ( ProbeListener listener : listeners ) { ProbeFilter filter = listener . getProbeFilter ( ) ; if ( filter . matches ( clazz ) ) { matchingListeners . add ( listener ) ; } } if ( ! matchingListeners . isEmpty ( ) ) { classesToTransform . add ( clazz ) ; addInterestedByClass ( clazz , matchingListeners ) ; } matchingListeners . clear ( ) ; } return classesToTransform ; }
Process recently registered listeners and calculate which classes need to be transformed with probes that drive the listeners .
239
19
161,216
synchronized Collection < Class < ? > > processRemovedListeners ( Collection < ProbeListener > listeners ) { Set < Class < ? > > classesToTransform = new HashSet < Class < ? > > ( ) ; for ( ProbeListener listener : listeners ) { Collection < ProbeImpl > listenerProbes = removeProbesByListener ( listener ) ; for ( ProbeImpl probe : listenerProbes ) { Class < ? > clazz = probe . getSourceClass ( ) ; removeInterestedByClass ( clazz , listener ) ; if ( removeListenerByProbe ( probe , listener ) ) { classesToTransform . add ( clazz ) ; } } } return classesToTransform ; }
Process the recently unregistered listeners and calculate which classes need to be transformed to remove deactivated probes .
143
20
161,217
public void classAvailable ( Class < ? > clazz ) { if ( ! isMonitorable ( clazz ) ) { return ; } listenersLock . readLock ( ) . lock ( ) ; try { for ( ProbeListener listener : allRegisteredListeners ) { ProbeFilter filter = listener . getProbeFilter ( ) ; if ( filter . matches ( clazz ) ) { addInterestedByClass ( clazz , Collections . singleton ( listener ) ) ; } } } finally { listenersLock . readLock ( ) . unlock ( ) ; } // Update the new class with the configured probes if ( ! getInterestedByClass ( clazz ) . isEmpty ( ) ) { this . transformer . instrumentWithProbes ( Collections . < Class < ? > > singleton ( clazz ) ) ; } }
Process a recently defined class to determine if it needs to be transformed with probes .
167
16
161,218
public synchronized ProbeImpl getProbe ( Class < ? > probedClass , String key ) { Map < String , ProbeImpl > classProbes = probesByKey . get ( probedClass ) ; if ( classProbes != null ) { return classProbes . get ( key ) ; } return null ; }
Get an existing instance of a probe with the specified source class and key .
66
15
161,219
public void addActiveProbesforListener ( ProbeListener listener , Collection < ProbeImpl > probes ) { // Add the probes for the specified listener. This is purely additive. // Since a listener's configuration can't be updated after registration, // we're adding probes for recently initialized / modified classes. addProbesByListener ( listener , probes ) ; for ( ProbeImpl probe : probes ) { addListenerByProbe ( probe , listener ) ; } }
Update the appropriate collections to reflect recently activated probes for the specified listener .
93
14
161,220
void addListenerByProbe ( ProbeImpl probe , ProbeListener listener ) { Set < ProbeListener > listeners = listenersByProbe . get ( probe ) ; if ( listeners == null ) { listeners = new CopyOnWriteArraySet < ProbeListener > ( ) ; listenersByProbe . putIfAbsent ( probe , listeners ) ; listeners = listenersByProbe . get ( probe ) ; } listeners . add ( listener ) ; }
Add the specified listener to the collection of listeners associated with the specified probe .
91
15
161,221
boolean removeListenerByProbe ( ProbeImpl probe , ProbeListener listener ) { boolean deactivatedProbe = false ; Set < ProbeListener > listeners = listenersByProbe . get ( probe ) ; if ( listeners != null ) { listeners . remove ( listener ) ; if ( listeners . isEmpty ( ) ) { deactivateProbe ( probe ) ; deactivatedProbe = true ; } } return deactivatedProbe ; }
Remove the specified listener from the collection of listeners associated with the specified probe .
90
15
161,222
synchronized void deactivateProbe ( ProbeImpl probe ) { listenersByProbe . remove ( probe ) ; activeProbesById . remove ( probe . getIdentifier ( ) ) ; Class < ? > clazz = probe . getSourceClass ( ) ; Map < String , ProbeImpl > classProbesByKey = probesByKey . get ( clazz ) ; classProbesByKey . remove ( probe . getName ( ) ) ; if ( classProbesByKey . isEmpty ( ) ) { probesByKey . remove ( clazz ) ; } }
Deactivate the specified probe and remove all data associated with the probe .
120
14
161,223
synchronized void addProbesByListener ( ProbeListener listener , Collection < ProbeImpl > probes ) { Set < ProbeImpl > listenerProbes = probesByListener . get ( listener ) ; if ( listenerProbes == null ) { listenerProbes = new HashSet < ProbeImpl > ( ) ; probesByListener . put ( listener , listenerProbes ) ; } listenerProbes . addAll ( probes ) ; }
Associate the specified collection of probes with the specified listener .
88
12
161,224
synchronized Collection < ProbeImpl > removeProbesByListener ( ProbeListener listener ) { Set < ProbeImpl > listenerProbes = probesByListener . remove ( listener ) ; if ( listenerProbes == null ) { listenerProbes = Collections . emptySet ( ) ; } return listenerProbes ; }
Remove all probes that were fired at the specified listener .
64
11
161,225
public boolean isExcludedClass ( String className ) { // We rely heavily on reflection to deliver probes if ( className . startsWith ( "java/lang/reflect" ) ) { return true ; } // Miscellaneous sun.misc classes if ( className . startsWith ( "sun/misc" ) ) { return true ; } // Sun VM generated accessors wreak havoc if ( className . startsWith ( "sun/reflect" ) ) { return true ; } // IBM J9 VM internals if ( className . startsWith ( "com/ibm/oti/" ) ) { return true ; } // Don't allow hooking into the monitoring code if ( className . startsWith ( "com/ibm/ws/monitor/internal" ) ) { return true ; } if ( className . startsWith ( "com/ibm/websphere/monitor" ) ) { return true ; } if ( className . startsWith ( "com/ibm/ws/boot/delegated/monitoring" ) ) { return true ; } if ( ( className . startsWith ( "com/ibm/ws/pmi" ) ) || ( className . startsWith ( "com/ibm/websphere/pmi" ) ) || ( className . startsWith ( "com/ibm/wsspi/pmi" ) ) ) { return true ; } //D89497-Excluding those classes which are not part of the Set. if ( ( ! ( probeMonitorSet . contains ( ( className . replace ( "/" , "." ) ) ) ) ) ) { return true ; } return false ; }
Determine if the named class is one that should be excluded from monitoring via probe injection . The patterns below generally include classes required to implement JVM function on which the monitoring code depends .
352
38
161,226
public boolean isMonitorable ( Class < ? > clazz ) { // Faster(?) path if ( notMonitorable . contains ( clazz ) ) { return false ; } else if ( monitorable . contains ( clazz ) ) { return true ; } boolean isMonitorable = true ; if ( ! instrumentation . isModifiableClass ( clazz ) ) { isMonitorable = false ; } else if ( clazz . isInterface ( ) ) { isMonitorable = false ; } else if ( clazz . isArray ( ) ) { isMonitorable = false ; } else if ( Proxy . isProxyClass ( clazz ) ) { isMonitorable = false ; } else if ( clazz . isPrimitive ( ) ) { isMonitorable = false ; } else if ( isExcludedClass ( Type . getInternalName ( clazz ) ) ) { isMonitorable = false ; } else if ( ! includeBootstrap && clazz . getClassLoader ( ) == null ) { isMonitorable = false ; } // Update collections if ( ! isMonitorable ) { synchronized ( notMonitorable ) { notMonitorable . add ( clazz ) ; } } else { monitorable . add ( clazz ) ; } return isMonitorable ; }
Determine of the specified class can be monitored via the probes infrastructure .
264
15
161,227
boolean checkPrefix ( char [ ] chars , int [ ] cursor ) { if ( chars . length > cursor [ 0 ] && chars [ cursor [ 0 ] ] == MatchSpace . NONWILD_MARKER ) return false ; if ( prefix == null ) return true ; if ( cursor [ 1 ] - cursor [ 0 ] < prefix . minlen ) // a conservative test, but if we can't pass it, we'll certainly fail later return false ; for ( int i = 0 ; i < prefix . items . length ; i ++ ) { Object item = prefix . items [ i ] ; if ( item == Pattern . matchOne ) if ( ! topicSkipForward ( chars , cursor ) ) return false ; else ; // topic skip succeeded so continue else if ( ! matchForward ( chars , ( char [ ] ) item , cursor ) ) return false ; // else this phase succeeded so continue } // The prefix matches exactly. But, unless we are at the end of the string, // the next character MUST be a separator. return cursor [ 0 ] == cursor [ 1 ] || chars [ cursor [ 0 ] ] == MatchSpace . SUBTOPIC_SEPARATOR_CHAR ; }
Override checkPrefix to implement topic semantics
249
8
161,228
static boolean topicSkipForward ( char [ ] chars , int [ ] cursor ) { if ( cursor [ 0 ] == cursor [ 1 ] ) return false ; while ( cursor [ 0 ] < cursor [ 1 ] && chars [ cursor [ 0 ] ] != MatchSpace . SUBTOPIC_SEPARATOR_CHAR ) cursor [ 0 ] ++ ; return true ; }
Skip forward to the next separator character
75
8
161,229
boolean checkSuffix ( char [ ] chars , int [ ] cursor ) { if ( suffix == null ) return true ; if ( cursor [ 1 ] - cursor [ 0 ] < suffix . minlen ) // a conservative test, but if we can't pass it, we'll certainly fail later return false ; int last = suffix . items . length - 1 ; for ( int i = last ; i >= 0 ; i -- ) { Object item = suffix . items [ i ] ; if ( item == Pattern . matchOne ) if ( ! topicSkipBackward ( chars , cursor ) ) return false ; else ; // topic skip succeeded so continue else if ( ! matchBackward ( chars , ( char [ ] ) item , cursor ) ) return false ; // else this phase succeeded so continue } // The suffix matches exactly. But, the preceding character MUST be a separator. We // don't allow start-of-string because we would not have checked the suffix // at all if it were allowed to extend to the beginning (it would then be identical // to the prefix). return cursor [ 0 ] < cursor [ 1 ] && chars [ cursor [ 1 ] - 1 ] == MatchSpace . SUBTOPIC_SEPARATOR_CHAR ; }
Override checkSuffix to implement topic semantics
258
9
161,230
static boolean topicSkipBackward ( char [ ] chars , int [ ] cursor ) { if ( cursor [ 0 ] == cursor [ 1 ] ) return false ; while ( cursor [ 0 ] < cursor [ 1 ] && chars [ cursor [ 1 ] - 1 ] != MatchSpace . SUBTOPIC_SEPARATOR_CHAR ) cursor [ 1 ] -- ; return true ; }
Skip backward to the next separator character
78
8
161,231
static boolean matchBackward ( char [ ] chars , char [ ] pattern , int [ ] cursor ) { int start = cursor [ 1 ] - pattern . length ; if ( start < cursor [ 0 ] ) // candidate is too short to possibly match return false ; if ( ! matchForward ( chars , pattern , new int [ ] { start , cursor [ 1 ] } ) ) return false ; // The candidate matches, so reflect that in the cursor cursor [ 1 ] = start ; return true ; }
Match characters in a backward direction
103
6
161,232
public static Object parsePattern ( String pattern ) { // Unfortunately, this method shares a fair amount of logic with Topic.parsePattern // but it is hard to figure out how to factor them. char [ ] accum = new char [ pattern . length ( ) ] ; int finger = 0 ; List tokens = new ArrayList ( ) ; boolean trivial = true ; for ( int i = 0 ; i < pattern . length ( ) ; i ++ ) { char c = pattern . charAt ( i ) ; if ( c == ' ' ) { finger = flush ( accum , finger , tokens ) ; tokens . add ( matchOne ) ; trivial = false ; } else if ( c == MatchSpace . SUBTOPIC_SEPARATOR_CHAR ) { // It's a normal character unless followed by another separator // or a "." if ( i == pattern . length ( ) - 1 ) { accum [ finger ++ ] = c ; } else { // Check to see if we have a double slash if ( pattern . charAt ( i + 1 ) == MatchSpace . SUBTOPIC_SEPARATOR_CHAR ) { // Double slash finger = flush ( accum , finger , tokens ) ; tokens . add ( matchMany ) ; trivial = false ; // Skip the second slash i ++ ; // If the next char is a '.', then we skip that too if ( pattern . charAt ( i + 1 ) == ' ' ) { // Skip the dot i ++ ; // Defect 307231, handle the allowable "//./" case if ( ( i + 1 ) < pattern . length ( ) && pattern . charAt ( i + 1 ) == MatchSpace . SUBTOPIC_SEPARATOR_CHAR ) { // Skip a subsequent slash i ++ ; } } } // Check for special "/." case which we jump over. Note that topic syntax // checking will already have disallowed invalid expressions such as "a/.b" // so if a "." follows a slash then it must be the final character, or it // must be followed by a separator. else if ( pattern . charAt ( i + 1 ) == ' ' ) { // skip the slash and the dot i ++ ; } else { accum [ finger ++ ] = c ; } } } else accum [ finger ++ ] = c ; } if ( trivial ) return new String ( accum , 0 , finger ) ; flush ( accum , finger , tokens ) ; return new TopicPattern ( tokens . iterator ( ) ) ; }
Parse a string topic pattern into a TopicPattern object
514
11
161,233
public static StringArrayWrapper create ( String [ ] data , String bigDestName ) throws JMSException { int size = 0 ; if ( data != null ) size = data . length ; List fakedFullMsgPath = new ArrayList ( size + 1 ) ; if ( size > 0 ) { for ( int i = 0 ; i < size ; i ++ ) { // Create the appropriate List element. String destName = data [ i ] ; String busName = null ; SIDestinationAddress sida ; // If this is of the form dest:bus if ( destName . indexOf ( BUS_SEPARATOR ) != - 1 ) { busName = destName . substring ( destName . indexOf ( BUS_SEPARATOR ) + 1 ) ; destName = destName . substring ( 0 , destName . indexOf ( BUS_SEPARATOR ) ) ; } try { sida = JmsServiceFacade . getSIDestinationAddressFactory ( ) . createSIDestinationAddress ( destName , busName ) ; fakedFullMsgPath . add ( sida ) ; } catch ( Exception e ) { // No FFDC code needed // This makes it the responsibility of the calling function to handle this // problem. Note that the StringArrayWrapper is used only to handle forward // and reverse routing paths, which are not supported function so this // code should never be driven in normal product operation. JMSException jmse = new JMSException ( e . getMessage ( ) ) ; jmse . setLinkedException ( e ) ; jmse . initCause ( e ) ; } //try } //for if ( bigDestName != null ) { // Make sure we add the real destination on the end of the msg FRP. try { SIDestinationAddress sida = ( ( SIDestinationAddressFactory ) JmsServiceFacade . getSIDestinationAddressFactory ( ) ) . createSIDestinationAddress ( bigDestName , null ) ; fakedFullMsgPath . add ( sida ) ; } catch ( Exception e ) { // No FFDC code needed // This makes it the responsibility of the calling function to handle this // problem. Note that the StringArrayWrapper is used only to handle forward // and reverse routing paths, which are not supported function so this // code should never be driven in normal product operation. JMSException jmse = new JMSException ( e . getMessage ( ) ) ; jmse . setLinkedException ( e ) ; jmse . initCause ( e ) ; } //try } //if } //if size > 0 StringArrayWrapper newSAW = new StringArrayWrapper ( fakedFullMsgPath ) ; return newSAW ; }
This method is used for unit test purposes to simulate the creation of a StringArrayWrapper whose destinations are all on the local bus .
580
27
161,234
public String [ ] getArray ( ) { // Create a copy to return to provide isolation. String [ ] newArray = null ; // Returning a list of the destination names excluding the // 'big' destination name. newArray = new String [ fullMsgPath . size ( ) - 1 ] ; for ( int i = 0 ; i < newArray . length ; i ++ ) { newArray [ i ] = ( ( SIDestinationAddress ) fullMsgPath . get ( i ) ) . getDestinationName ( ) ; } //for return newArray ; }
Returns a list of the destination names not including the big destination name .
118
14
161,235
public void createDestinationLocalization ( DestinationDefinition destinationDefinition , LocalizationDefinition destinationLocalizationDefinition , Set destinationLocalizingMEs , boolean isTemporary ) throws SIResourceException , SIMPDestinationAlreadyExistsException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createDestinationLocalization" , new Object [ ] { destinationDefinition , destinationLocalizationDefinition , destinationLocalizingMEs , new Boolean ( isTemporary ) } ) ; destinationManager . createDestinationLocalization ( destinationDefinition , destinationLocalizationDefinition , destinationLocalizingMEs , false ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createDestinationLocalization" ) ; }
Method only called by unit tests to create destinations
180
9
161,236
@ Override public void introspect ( PrintWriter writer ) { RuntimeMXBean runtime = ManagementFactory . getRuntimeMXBean ( ) ; introspectUptime ( runtime , writer ) ; introspectVendorVersion ( runtime , writer ) ; introspectInputArguments ( runtime , writer ) ; Map < String , String > props = introspectSystemProperties ( runtime , writer ) ; //introspectPaths(runtime, writer); introspectDirsFromSystemProperties ( runtime , writer , "java.ext.dirs" , props ) ; introspectDirsFromSystemProperties ( runtime , writer , "java.endorsed.dirs" , props ) ; }
Grab a snapshot of the current system properties .
146
9
161,237
public ArrayList getProperties ( ) { ArrayList properties = new ArrayList ( ) ; if ( configEntry . properties != null ) { Iterator it = configEntry . properties . values ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Property property = new Property ( ( com . ibm . ws . cache . config . Property ) it . next ( ) ) ; properties . add ( property ) ; } } return properties ; }
This method returns a list of properties defined on a cache - entry
97
13
161,238
public CacheId [ ] getCacheIds ( ) { CacheId [ ] cacheIds = new CacheId [ configEntry . cacheIds . length ] ; for ( int i = 0 ; i < configEntry . cacheIds . length ; i ++ ) { cacheIds [ i ] = new CacheId ( configEntry . cacheIds [ i ] ) ; } return cacheIds ; }
This method returns an array of CacheId objects that contain cache ID generation rules used to produce a valid cache ID .
85
23
161,239
public DependencyId [ ] getDependencyIds ( ) { DependencyId [ ] depIds = new DependencyId [ configEntry . dependencyIds . length ] ; for ( int i = 0 ; i < configEntry . dependencyIds . length ; i ++ ) { depIds [ i ] = new DependencyId ( configEntry . dependencyIds [ i ] ) ; } return depIds ; }
This method returns an array of DependencyId objects that specified addditional cache indentifers that associated multiple cache entries to the same group identiifier .
91
32
161,240
public Invalidation [ ] getInvalidations ( ) { Invalidation [ ] invalidations = new Invalidation [ configEntry . invalidations . length ] ; for ( int i = 0 ; i < configEntry . invalidations . length ; i ++ ) { invalidations [ i ] = new Invalidation ( configEntry . invalidations [ i ] ) ; } return invalidations ; }
This method returns an array of Invalidation objects that written custom Java code or through rules that are defined in the cache policy of each entry .
78
28
161,241
private void closeSocketChannel ( SocketChannel sc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { try { Tr . event ( this , tc , "Closing connection, local: " + sc . socket ( ) . getLocalSocketAddress ( ) + " remote: " + sc . socket ( ) . getRemoteSocketAddress ( ) ) ; } catch ( Throwable t ) { // protect against JDK PK42970 throwing illegal arg } } try { sc . close ( ) ; } catch ( IOException ioe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "IOException caught while closing connection " + ioe ) ; } } }
Handle closing the socket channel with appropriate debug and error protection .
168
12
161,242
public static Class < ? > [ ] toTypeArray ( String [ ] s ) throws ClassNotFoundException { if ( s == null ) return null ; Class < ? > [ ] c = new Class [ s . length ] ; for ( int i = 0 ; i < s . length ; i ++ ) { c [ i ] = forName ( s [ i ] ) ; } return c ; }
Converts an array of Class names to Class types .
84
11
161,243
public static String [ ] toTypeNameArray ( Class < ? > [ ] c ) { if ( c == null ) return null ; String [ ] s = new String [ c . length ] ; for ( int i = 0 ; i < c . length ; i ++ ) { s [ i ] = c [ i ] . getName ( ) ; } return s ; }
Converts an array of Class types to Class names .
78
11
161,244
public boolean add ( Object o ) { synchronized ( pool ) { if ( index < pool . length ) { pool [ index ++ ] = o ; // if (DEBUG && tc.isDebugEnabled() ) // Tr.debug(tc,"added to pool " + name + " at " + index); return true ; } } // if (DEBUG && tc.isDebugEnabled() ) // Tr.debug(tc,"pool " + name + " is full"); return false ; }
Returns true if the object was added back to the pool
99
11
161,245
protected synchronized Dispatchable getThreadContext ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getThreadContext" ) ; // Start D202625 // Save the position of the data int currentPos = data . position ( ) ; int currentLimit = data . limit ( ) ; Dispatchable dis = null ; try { dis = listener . getThreadContext ( conversation , data , segmentType ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , "com.ibm.ws.sib.jfapchannel.impl.rldispatcher.ConversationReceiveListenerDataReceivedInvocation.getThreadContext" , JFapChannelConstants . CRLDATARECEIVEDINVOKE_GETTHREADCONTEXT_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "exception thrown by getThreadContext" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( this , tc , t ) ; // User has thrown an exception from getThreadContext method. Probably // the best way to deal with this is to invalidate their connection. // That'll learn 'em. connection . invalidate ( true , t , "exception thrown from getThreadContext - " + t . getMessage ( ) ) ; // D224570 // Throw this bad boy to indicate to the dispatcher that something has gone wrong and // that it should abort processing this segment. throw new SIErrorException ( TraceNLS . getFormattedMessage ( JFapChannelConstants . MSG_BUNDLE , "CRLDRI_INTERNAL_SICJ0065" , null , "CRLDRI_INTERNAL_SICJ0065" ) ) ; // D226223 } // Make sure we re-position the data data . position ( currentPos ) ; data . limit ( currentLimit ) ; // End D202625 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getThreadContext" , dis ) ; return dis ; }
This method will ask the receive listener for the thread context .
510
12
161,246
public void setLogDataDirectory ( String logDataDirectory ) { LogState state = ivLog . setDataDirectory ( logDataDirectory ) ; if ( state != null ) { updateLogConfiguration ( state ) ; state . copyTo ( ivLog ) ; } }
Setters for Log Data
54
5
161,247
private void updateTraceConfiguration ( TraceState state ) { if ( DIRECTORY_TYPE . equals ( state . ivStorageType ) ) { LogRepositoryComponent . setTraceDirectoryDestination ( state . ivDataDirectory , state . ivPurgeBySizeEnabled , state . ivPurgeByTimeEnabled , state . ivFileSwitchEnabled , state . ivBufferingEnabled , state . ivPurgeMaxSize * ONE_MEG , state . ivPurgeMinTime * MILLIS_IN_HOURS , state . ivFileSwitchTime , state . ivOutOfSpaceAction ) ; } else if ( MEMORYBUFFER_TYPE . equals ( state . ivStorageType ) ) { LogRepositoryComponent . setTraceMemoryDestination ( state . ivDataDirectory , state . ivMemoryBufferSize * ONE_MEG ) ; } else { throw new IllegalArgumentException ( "Unknown value for trace storage type: " + state . ivStorageType ) ; } }
update all info for Trace Repository
205
7
161,248
public void setTraceMemory ( String dataDirectory , long memoryBufferSize ) { TraceState state = ( TraceState ) ivTrace . clone ( ) ; state . ivStorageType = MEMORYBUFFER_TYPE ; state . ivDataDirectory = dataDirectory ; state . ivMemoryBufferSize = memoryBufferSize ; updateTraceConfiguration ( state ) ; state . copyTo ( ivTrace ) ; }
Modify the trace to use a memory buffer
85
9
161,249
private static HttpServletRequest getWrappedServletRequestObject ( HttpServletRequest sr ) { if ( sr instanceof HttpServletRequestWrapper ) { HttpServletRequestWrapper w = ( HttpServletRequestWrapper ) sr ; // make sure we drill all the way down to an // SRTServletRequest...there // may be multiple proxied objects sr = ( HttpServletRequest ) w . getRequest ( ) ; while ( sr instanceof HttpServletRequestWrapper ) sr = ( HttpServletRequest ) ( ( HttpServletRequestWrapper ) sr ) . getRequest ( ) ; } return sr ; }
Drill down through any possible HttpServletRequestWrapper objects .
144
15
161,250
public static FileSharedServerLeaseLog getFileSharedServerLeaseLog ( String logDirStem , String localRecoveryIdentity , String recoveryGroup ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "FileSharedServerLeaseLog" , new Object [ ] { logDirStem , localRecoveryIdentity , recoveryGroup } ) ; if ( _serverInstallLeaseLogDir == null ) setLeaseLog ( logDirStem , localRecoveryIdentity , recoveryGroup ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "FileSharedServerLeaseLog" , _fileLeaseLog ) ; return _fileLeaseLog ; }
Access the singleton instance of the FileSystem Lease log .
156
13
161,251
public static int parseRMICCompatible ( String options ) // PM46698 { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "parseRMICCompatible: " + options ) ; int flags ; if ( options == null ) { flags = RMIC_COMPATIBLE_DEFAULT ; } else if ( options . equals ( "none" ) ) { flags = 0 ; } else if ( options . isEmpty ( ) || options . equals ( "all" ) ) { flags = - 1 ; } else { flags = 0 ; for ( String option : options . split ( "," ) ) { if ( option . equals ( "values" ) ) { flags |= RMIC_COMPATIBLE_VALUES ; } else if ( option . equals ( "exceptions" ) ) // PM94096 { flags |= RMIC_COMPATIBLE_EXCEPTIONS ; } else { throw new IllegalArgumentException ( "unknown RMIC compatibility option: " + option ) ; } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "parseRMICCompatible: " + Integer . toHexString ( flags ) ) ; return flags ; }
Parse an rmic compatibility options string .
286
9
161,252
public static void registerJIT_StubClassPlugin ( ClassLoader classloader ) { boolean isRegistered = JIT_StubPluginImpl . register ( classloader ) ; if ( ! isRegistered ) { throw new IllegalArgumentException ( "Specified ClassLoader does not support JIT_StubClassPlugin : " + classloader ) ; } }
F1339 - 8988
74
6
161,253
synchronized void setStageTopics ( String stageName , String [ ] topics ) { for ( String t : topics ) { if ( t . equals ( "*" ) ) { wildcardStageTopics . put ( "" , stageName ) ; } else if ( t . endsWith ( "/*" ) ) { wildcardStageTopics . put ( t . substring ( 0 , t . length ( ) - 1 ) , stageName ) ; } else { discreteStageTopics . put ( t , stageName ) ; } } // Clear the cache since it's no longer up to date clearTopicDataCache ( ) ; }
Set the list of topics to be associated with the specified work stage .
130
14
161,254
TopicData getTopicData ( Topic topic , String topicName ) { TopicData topicData = null ; if ( topic != null ) { topicData = topic . getTopicData ( ) ; } if ( topicData == null ) { topicData = topicDataCache . get ( topicName ) ; if ( topic != null && topicData != null ) { topic . setTopicDataReference ( topicData . getReference ( ) ) ; } } if ( topicData == null ) { synchronized ( this ) { topicData = buildTopicData ( topicName ) ; if ( topic != null ) { topic . setTopicDataReference ( topicData . getReference ( ) ) ; } } } return topicData ; }
Get the cached information about the specified topic . The cached data will allow us to avoid the expense of finding various and sundry data associated with a specific topic and topic hierarchies .
146
36
161,255
public boolean accessDenied ( InetAddress remoteAddr ) { String hostname = null ; //F184719 // check the inclusion lists first to see if the client matches if ( includeAccess . getActive ( ) || includeAccessNames . getActive ( ) ) { boolean closeSocket = true ; if ( includeAccess . getActive ( ) ) { if ( remoteAddr instanceof Inet6Address ) { if ( includeAccess . findInList6 ( remoteAddr . getAddress ( ) ) ) { closeSocket = false ; } } else { if ( includeAccess . findInList ( remoteAddr . getAddress ( ) ) ) { closeSocket = false ; } } } if ( closeSocket && includeAccessNames . getActive ( ) ) { // look at hostnames to check inclusion hostname = remoteAddr . getHostName ( ) ; if ( caseInsensitiveHostnames && ( hostname != null ) ) { hostname = hostname . toLowerCase ( ) ; } if ( includeAccessNames . findInList ( hostname ) ) { closeSocket = false ; } } if ( closeSocket ) { // close the excluded socket connection if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Address and host name not in include list, address: " + remoteAddr . getHostAddress ( ) + " host name: " + remoteAddr . getHostName ( ) ) ; return true ; } } if ( excludeAccess . getActive ( ) || excludeAccessNames . getActive ( ) ) { boolean closeSocket = false ; if ( excludeAccess . getActive ( ) ) { if ( remoteAddr instanceof Inet6Address ) { if ( excludeAccess . findInList6 ( remoteAddr . getAddress ( ) ) ) { // close the excluded socket connection if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Address (IPv6) in exclude list, address: " + remoteAddr . getHostAddress ( ) ) ; return true ; } } else { if ( excludeAccess . findInList ( remoteAddr . getAddress ( ) ) ) { // close the excluded socket connection if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Address in exclude list, address: " + remoteAddr . getHostAddress ( ) ) ; return true ; } } } if ( closeSocket == false && excludeAccessNames . getActive ( ) ) { // look at hostnames to check exclusion hostname = remoteAddr . getHostName ( ) ; if ( caseInsensitiveHostnames && ( hostname != null ) ) { hostname = hostname . toLowerCase ( ) ; } if ( excludeAccessNames . findInList ( hostname ) ) { // close the excluded socket connection if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Host name in exclude list, host name: " + remoteAddr . getHostName ( ) ) ; return true ; } } } // end if(there are excludes to check) return false ; }
Query whether a given client address is denied by this configuration .
692
12
161,256
@ Override public void sendAckMessage ( SIBUuid8 sourceMEUuid , SIBUuid12 destUuid , SIBUuid8 busUuid , long ackPrefix , int priority , Reliability reliability , SIBUuid12 stream , boolean consolidate ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendAckMessage" , new Long ( ackPrefix ) ) ; ControlAck ackMsg = createControlAckMessage ( ) ; // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want. SIMPUtils . setGuaranteedDeliveryProperties ( ackMsg , _messageProcessor . getMessagingEngineUuid ( ) , sourceMEUuid , stream , null , destUuid , ProtocolType . UNICASTOUTPUT , GDConfig . PROTOCOL_VERSION ) ; ackMsg . setPriority ( priority ) ; ackMsg . setReliability ( reliability ) ; ackMsg . setAckPrefix ( ackPrefix ) ; // Send Ack messages at the priority of the original message +1 sendToME ( ackMsg , sourceMEUuid , busUuid , priority + 1 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendAckMessage" ) ; }
sendAckMessage is called from preCommitCallback after the message has been delivered to the final destination
327
21
161,257
@ Override public void sendNackMessage ( SIBUuid8 sourceMEUuid , SIBUuid12 destUuid , SIBUuid8 busUuid , long startTick , long endTick , int priority , Reliability reliability , SIBUuid12 stream ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendNackMessage" , new Object [ ] { new Long ( startTick ) , new Long ( endTick ) } ) ; ControlNack nackMsg = createControlNackMessage ( ) ; // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want. SIMPUtils . setGuaranteedDeliveryProperties ( nackMsg , _messageProcessor . getMessagingEngineUuid ( ) , sourceMEUuid , stream , null , destUuid , ProtocolType . UNICASTOUTPUT , GDConfig . PROTOCOL_VERSION ) ; nackMsg . setPriority ( priority ) ; nackMsg . setReliability ( reliability ) ; nackMsg . setStartTick ( startTick ) ; nackMsg . setEndTick ( endTick ) ; // Send Nack messages at original message priority +2 sendToME ( nackMsg , sourceMEUuid , busUuid , priority + 2 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendNackMessage " ) ; }
Sends a Nack message back to the originating ME
351
11
161,258
private ControlNack createControlNackMessage ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createControlNackMessage" ) ; ControlNack nackMsg = null ; // Create new NackMessage try { nackMsg = _cmf . createNewControlNack ( ) ; } catch ( MessageCreateFailedException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PtoPInputHandler.createControlNackMessage" , "1:1604:1.323" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "createControlNackMessage" , e ) ; } SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PtoPInputHandler" , "1:1616:1.323" , e } ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PtoPInputHandler" , "1:1624:1.323" , e } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createControlNackMessage" ) ; return nackMsg ; }
Creates an NACK message for sending
403
8
161,259
protected ControlRequestFlush createControlRequestFlush ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createControlRequestFlush" ) ; ControlRequestFlush rflushMsg = null ; // Create new message try { rflushMsg = _cmf . createNewControlRequestFlush ( ) ; } catch ( MessageCreateFailedException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PtoPInputHandler.createControlRequestFlush" , "1:1717:1.323" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "createControlRequestFlush" , e ) ; } SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PtoPInputHandler" , "1:1729:1.323" , e } ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PtoPInputHandler" , "1:1737:1.323" , e } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createControlRequestFlush" , rflushMsg ) ; return rflushMsg ; }
Creates a REQUESTFLUSH message for sending
408
10
161,260
private int checkCanExceptionMessage ( DestinationHandler destinationHandler ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkCanExceptionMessage" , new Object [ ] { destinationHandler } ) ; // Destination exception destination handler ExceptionDestinationHandlerImpl exceptionDestinationHandler = null ; // Instantiate an ExceptionDestinationHandlerImpl for the destination exceptionDestinationHandler = new ExceptionDestinationHandlerImpl ( destinationHandler ) ; int returnValue = exceptionDestinationHandler . checkCanExceptionMessage ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkCanExceptionMessage" , Integer . valueOf ( returnValue ) ) ; return returnValue ; }
Check whether it will be possible to place a message on the exception destination belonging to a destination .
171
19
161,261
private int checkTargetAbleToAcceptOrExceptionMessage ( JsDestinationAddress targetDestinationAddr ) throws SITemporaryDestinationNotFoundException , SIResourceException , SINotPossibleInCurrentConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkTargetAbleToAcceptOrExceptionMessage" , targetDestinationAddr ) ; int blockingReason = DestinationHandler . OUTPUT_HANDLER_NOT_FOUND ; // If the original routingDestination address in the message was blank we simply return // 'not found'. if ( targetDestinationAddr != null ) { // Lookup the routing (target) destination. This may throw a SIMPNotPossibleInCurrentConfigurationException. DestinationHandler targetDestination = _messageProcessor . getDestinationManager ( ) . getDestination ( targetDestinationAddr , false ) ; SIBUuid8 targetDestinationMEUuid = targetDestinationAddr . getME ( ) ; // Can the routing destination accept a message blockingReason = targetDestination . checkCanAcceptMessage ( targetDestinationMEUuid , null ) ; // If the target is full (or put-disabled, etc) then we want to go on & see if we can // put to the exception destination of the target destination if ( blockingReason != DestinationHandler . OUTPUT_HANDLER_FOUND ) { int linkBlockingReason = checkCanExceptionMessage ( targetDestination ) ; // If we can exception the message then reset the blockingReason return code if ( linkBlockingReason == DestinationHandler . OUTPUT_HANDLER_FOUND ) blockingReason = DestinationHandler . OUTPUT_HANDLER_FOUND ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkTargetAbleToAcceptOrExceptionMessage" , Integer . valueOf ( blockingReason ) ) ; return blockingReason ; }
See if a target destination or if necessary its exception destination can handle any more messages .
434
17
161,262
private int checkLinkAbleToExceptionMessage ( ) throws SIException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkLinkAbleToExceptionMessage" ) ; int blockingReason = DestinationHandler . OUTPUT_HANDLER_NOT_FOUND ; blockingReason = checkCanExceptionMessage ( _destination ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkLinkAbleToExceptionMessage" , Integer . valueOf ( blockingReason ) ) ; return blockingReason ; }
See if a link s exception destination can handle any more messages .
141
13
161,263
void balancedPush ( int state , GBSNode node ) { push ( state , node ) ; if ( node . balance ( ) != 0 ) _bpidx = _cidx ; }
Push a node and associated state onto the stack remembering a height imbalance if there is one .
41
18
161,264
void processSubFringe ( GBSNode p ) { /* Depth of a balanced T-zero tree for */ /* this tree's K factor */ int t0_depth = _tree . tZeroDepth ( ) ; /* Determine top-most node we must visit in the tree walk */ int ntop = 0 ; /* This is the index within the */ /* NodeStack that represents the top */ /* of the sub-tree. We start by */ /* assuming we have to walk the whole */ /* tree. */ int xChild = 0 ; /* Assume current node has no children */ if ( p . hasChild ( ) ) xChild = 1 ; /* Allow for terminal child */ if ( index ( ) > t0_depth ) /* Have at least a whole t0 sub-tree */ ntop = index ( ) - ( t0_depth - xChild ) ; innerProcessSubTree ( p , NodeStack . VISIT_RIGHT , ntop ) ; }
Walk through a fringe of the tree .
202
8
161,265
private void innerProcessSubTree ( GBSNode p , int initialState , int topIndex ) { boolean done = false ; _topIndex = topIndex ; _endp = p ; _endIndex = _idx ; GBSNode q ; /* Used for tree walking */ int s = initialState ; while ( ! done ) { switch ( s ) { case NodeStack . VISIT_LEFT : s = NodeStack . PROCESS_CURRENT ; q = p . leftChild ( ) ; while ( q != null ) { push ( s , p ) ; p = q ; q = p . leftChild ( ) ; } break ; case NodeStack . PROCESS_CURRENT : s = NodeStack . VISIT_RIGHT ; done = processNode ( p ) ; _endp = p ; /* Last node processed */ _endIndex = _idx ; /* Index to parent of last node processed*/ break ; case NodeStack . VISIT_RIGHT : s = NodeStack . DONE_VISITS ; q = p . rightChild ( ) ; if ( q != null ) { push ( s , p ) ; s = NodeStack . VISIT_LEFT ; p = p . rightChild ( ) ; } break ; case NodeStack . DONE_VISITS : if ( _idx == topIndex ) /* Have finally hit end of sub-tree */ done = true ; else { s = _state [ _cidx ] ; p = _node [ _cidx ] ; pop ( ) ; } break ; default : throw new RuntimeException ( "Help!, s = " + s + "." ) ; // break; } /* switch(s) */ } /* while ( !done ) */ }
Walk through an entire sub - tree invoking processNode on each node .
364
14
161,266
public String stateName ( int state ) { String name = "Unknown state = " + state ; switch ( state ) { case NodeStack . VISIT_LEFT : name = "VISIT_LEFT" ; break ; case NodeStack . PROCESS_CURRENT : name = "PROCESS_CURRENT" ; break ; case NodeStack . VISIT_RIGHT : name = "VISIT_RIGHT" ; break ; case NodeStack . DONE_VISITS : name = "DONE_VISITS" ; break ; } return name ; }
Return the name of a node state
119
7
161,267
public final static void logException ( TraceComponent compTc , Throwable t , EJBMethodMetaData m , BeanO bean ) { //d408351 - only log recursive exceptions if they have not been logged before if ( hasBeenLogged ( t ) ) { return ; } BeanId beanId = null ; if ( bean != null ) { beanId = bean . getId ( ) ; } if ( m == null ) { if ( beanId == null ) { Tr . error ( compTc , "NON_APPLICATION_EXCEPTION_CNTR0018E" , t ) ; } else { Tr . error ( compTc , "NON_APPLICATION_EXCEPTION_ON_BEAN_CNTR0021E" , new Object [ ] { t , beanId } ) ; } } else { String methodName = m . getMethodName ( ) ; if ( beanId == null ) { Tr . error ( compTc , "NON_APPLICATION_EXCEPTION_METHOD_CNTR0019E" , new Object [ ] { t , methodName } ) ; } else { Tr . error ( compTc , "NON_APPLICATION_EXCEPTION_METHOD_ON_BEAN_CNTR0020E" , new Object [ ] { t , methodName , beanId } ) ; } } }
d408351 - added new signature with customizable TraceComponent
297
11
161,268
static public Throwable findRootCause ( Throwable throwable ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "findRootCause: " + throwable ) ; } Throwable root = throwable ; Throwable next = root ; while ( next != null ) { root = next ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "finding cause of: " + root . getClass ( ) . getName ( ) ) ; } if ( root instanceof java . rmi . RemoteException ) { next = ( ( java . rmi . RemoteException ) root ) . detail ; } else if ( root instanceof WsNestedException ) // d162976 { next = ( ( WsNestedException ) root ) . getCause ( ) ; // d162976 } else if ( root instanceof TransactionRolledbackLocalException ) //d180095 begin { next = ( ( TransactionRolledbackLocalException ) root ) . getCause ( ) ; } else if ( root instanceof AccessLocalException ) { next = ( ( AccessLocalException ) root ) . getCause ( ) ; } else if ( root instanceof NoSuchObjectLocalException ) { next = ( ( NoSuchObjectLocalException ) root ) . getCause ( ) ; } else if ( root instanceof TransactionRequiredLocalException ) { next = ( ( TransactionRequiredLocalException ) root ) . getCause ( ) ; } // else if (root instanceof InvalidActivityLocalException) // { // root = ((InvalidActivityLocalException) root).getCause(); // } // else if (root instanceof ActivityRequiredLocalException) // { // root = ((ActivityRequiredLocalException) root).getCause(); // } // else if (root instanceof ActivityCompletedLocalException) // { // next = ((ActivityCompletedLocalException) root).getCause(); //d180095 end // } else if ( root instanceof NamingException ) { next = ( ( NamingException ) root ) . getRootCause ( ) ; } else if ( root instanceof InvocationTargetException ) { next = ( ( InvocationTargetException ) root ) . getTargetException ( ) ; } else if ( root instanceof org . omg . CORBA . portable . UnknownException ) { next = ( ( org . omg . CORBA . portable . UnknownException ) root ) . originalEx ; } else if ( root instanceof InjectionException ) // d436080 { next = root . getCause ( ) ; } else { next = null ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "findRootCause returning: " + root ) ; return root ; }
Finds the root cause of a Throwable that occured . This routine will continue to look through chained Throwables until it cannot find another chained Throwable and return the last one in the chain as the root cause .
605
44
161,269
public static Exception Exception ( Throwable cause ) { return ( cause instanceof Exception ) ? ( Exception ) cause : new Exception ( "See nested Throwable" , cause ) ; }
F71894 . 1
37
5
161,270
protected ClientBehaviorAttachedObjectTargetImpl createAttachedObjectTarget ( FaceletContext ctx ) { ClientBehaviorAttachedObjectTargetImpl target = new ClientBehaviorAttachedObjectTargetImpl ( ) ; if ( _event != null ) { target . setEvent ( _event . getValueExpression ( ctx , String . class ) ) ; } if ( _name != null ) { target . setName ( _name . getValueExpression ( ctx , String . class ) ) ; } if ( _default != null ) { target . setDefault ( _default . getBoolean ( ctx ) ) ; } if ( _targets != null ) { target . setTargets ( _targets . getValueExpression ( ctx , String . class ) ) ; } return target ; }
Create a new AttachedObjectTarget instance to be added on the target list .
173
16
161,271
private void registerEndpointMBean ( String name , EndPointInfoImpl ep ) { endpointMBeans . put ( name , registerMBeanAsService ( name , ep ) ) ; }
Register an endpoint MBean and publish it .
42
10
161,272
private EndPointInfoImpl updateEndpointMBean ( String name , String host , int port ) { EndPointInfoImpl existingEP = endpoints . get ( name ) ; existingEP . updateHost ( host ) ; existingEP . updatePort ( port ) ; return existingEP ; }
Update an existing endpoint MBean which will emit change notifications .
60
13
161,273
private void destroyEndpointMBeans ( ) { for ( Map . Entry < String , ServiceRegistration < DynamicMBean > > mbean : endpointMBeans . entrySet ( ) ) { String mbeanName = mbean . getKey ( ) ; endpointMBeans . remove ( mbeanName ) ; mbean . getValue ( ) . unregister ( ) ; } }
For each registered MBean unpublish unregister and remove from the map .
82
17
161,274
public static void destroyEndpoints ( ) { EndPointMgrImpl _this = ( EndPointMgrImpl ) getRef ( ) ; synchronized ( _this . endpoints ) { _this . destroyEndpointMBeans ( ) ; _this . endpoints . clear ( ) ; } }
Destroy all of the defined endpoints .
62
8
161,275
private void unregisterMBeanInService ( String name ) { ServiceRegistration < DynamicMBean > existingMBean = endpointMBeans . remove ( name ) ; if ( existingMBean != null ) { existingMBean . unregister ( ) ; } }
Remove the MBean from the map of registered MBeans and unregister it .
59
18
161,276
@ Override public void removeEndPoint ( String name ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Deleting endpoint: " + name ) ; } synchronized ( this . endpoints ) { if ( this . endpoints . remove ( name ) != null ) { unregisterMBeanInService ( name ) ; } } }
Delete the endpoint that matches the provided name .
90
9
161,277
private static String [ ] getTokensArray ( String tokenComposite ) throws ParseException { if ( tokenComposite == null || "" . equals ( tokenComposite ) ) { return null ; } return parseNameTokens ( tokenComposite ) ; }
Takes a string that is a composite of tokens extracts tokens delimited by any whitespace character sequence combination and returns a String array of such tokens .
56
30
161,278
static public String [ ] parseNameTokens ( String stringValue ) { if ( stringValue == null ) { return null ; } ArrayList < String > list = new ArrayList < String > ( 5 ) ; int length = stringValue . length ( ) ; boolean inSpace = true ; int start = 0 ; for ( int i = 0 ; i < length ; i ++ ) { char ch = stringValue . charAt ( i ) ; // We're in whitespace; if we've just departed // a run of non-whitespace, append a string. // Now, why do we use the supposedly deprecated "Character.isSpace()" // function instead of "isWhitespace"? We're following XML rules // here for the meaning of whitespace, which specifically // EXCLUDES general Unicode spaces. if ( Character . isWhitespace ( ch ) ) { if ( ! inSpace ) { list . add ( stringValue . substring ( start , i ) ) ; inSpace = true ; } } // We're out of whitespace; if we've just departed // a run of whitespace, start keeping track of this string else { if ( inSpace ) { start = i ; inSpace = false ; } } } if ( ! inSpace ) { list . add ( stringValue . substring ( start ) ) ; } if ( list . isEmpty ( ) ) { return null ; } return list . toArray ( new String [ list . size ( ) ] ) ; }
Parses a whitespace separated series of name tokens .
311
12
161,279
public static FlowType getKey ( int ordinal ) { if ( ordinal >= 0 && ordinal < _values . length ) { return _values [ ordinal ] ; } return null ; }
Fetch the FlowType for a particular integer .
41
10
161,280
public boolean containsChannel ( String channelName ) { boolean found = false ; for ( int i = 0 ; i < channels . length ; i ++ ) { if ( channels [ i ] . getName ( ) . equals ( channelName ) ) { found = true ; break ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "containsChannel: " + channelName + "=" + found ) ; } return found ; }
Check whether this chain contains the input channel name .
108
10
161,281
private static boolean needsEncoding ( String s , boolean relax , boolean [ ] unreserved ) { int len = s . length ( ) ; for ( int i = 0 ; i < len ; ++ i ) { char c = s . charAt ( i ) ; if ( c == ' ' && relax ) { continue ; } if ( c > unreserved . length ) { return true ; } if ( unreserved [ c ] == false ) { return true ; } } return false ; }
Determines if the input string contains any invalid URI characters that require encoding
102
15
161,282
public Object getWLMEndPointData ( ) { if ( mode != PropertiesType . WLM_EP ) { throw new SIErrorException ( nls . getFormattedMessage ( "INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006" , null , "INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006" ) // D270373 ) ; } return wlmEndPointData ; }
Returns the WLM endpoint data associated with this instance of connection properties . This is only valid if the instance was created to use the WLM endpoint mode of operation . An IllegalArgumentException will be thrown otherwise .
97
43
161,283
public static String getContextRootNotFoundMessage ( ) { // this does not return a default string, since the caller may (and does in our case) choose to build a runtime // dependent string. HttpDispatcher f = instance . get ( ) . get ( ) ; if ( f != null ) return f . appOrContextRootNotFound ; return null ; }
Get the value for the appOrContextRootMissingMessage custom property . return null if it was not set .
78
22
161,284
public boolean isTrusted ( String hostAddr , String headerName ) { if ( ! wcTrusted ) { return false ; } if ( HttpHeaderKeys . isSensitivePrivateHeader ( headerName ) ) { // if this is a sensitive private header, check trustedSensitiveHeaderOrigin values return isTrustedForSensitiveHeaders ( hostAddr ) ; } if ( ! usePrivateHeaders ) { // trustedHeaderOrigin list is explicitly set to "none" return isTrustedForSensitiveHeaders ( hostAddr ) ; } if ( restrictPrivateHeaderOrigin == null ) { // trustedHeaderOrigin list is set to "*" return true ; } else { // check trustedHeaderOrigin for given host IP boolean trustedOrigin = restrictPrivateHeaderOrigin . contains ( hostAddr . toLowerCase ( ) ) ; if ( ! trustedOrigin ) { // if hostAddr is not in trustedHeaderOrigin, allow trustedSensitiveHeaderOrigin to override trust trustedOrigin = isTrustedForSensitiveHeaders ( hostAddr ) ; } return trustedOrigin ; } }
Check to see if the source host address is one we allow for specification of private headers
226
17
161,285
public boolean isTrustedForSensitiveHeaders ( String hostAddr ) { if ( ! useSensitivePrivateHeaders ) { // trustedSensitiveHeaderOrigin list is either unset (defaults to "none") or explicitly set to "none" return false ; } if ( restrictSensitiveHeaderOrigin == null ) { // trustedSensitiveHeaderOrigin is set to "*" return true ; } else { // check trustedSensitiveHeaderOrigin list for given host IP return restrictSensitiveHeaderOrigin . contains ( hostAddr . toLowerCase ( ) ) ; } }
Check to see if the source host address is one we allow for specification of sensitive private headers
120
18
161,286
public static ExecutorService getExecutorService ( ) { HttpDispatcher f = instance . get ( ) . get ( ) ; if ( f == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "HttpDispatcher instance not found" ) ; } return null ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "HttpDispatcher instance: " + f . toString ( ) ) ; } return f . executorService ; } }
Access the collaboration engine .
137
5
161,287
public static CHFWBundle getCHFWBundle ( ) { HttpDispatcher f = instance . get ( ) . get ( ) ; if ( f != null ) return f . chfw ; return null ; }
Access the channel framework bundle .
47
6
161,288
public static WsByteBufferPoolManager getBufferManager ( ) { final CHFWBundle chfw = getCHFWBundle ( ) ; if ( null == chfw ) { return ChannelFrameworkFactory . getBufferManager ( ) ; } return chfw . getBufferManager ( ) ; }
Access the current reference to the bytebuffer pool manager .
62
11
161,289
public static ChannelFramework getFramework ( ) { final CHFWBundle chfw = getCHFWBundle ( ) ; if ( null == chfw ) { return ChannelFrameworkFactory . getChannelFramework ( ) ; } return chfw . getFramework ( ) ; }
Access the current reference to the channel framework instance .
60
10
161,290
@ Reference ( name = "workClassifier" , policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . OPTIONAL ) protected void setWorkClassifier ( WorkClassifier service ) { workClassifier = service ; }
DS method for setting the Work Classification service reference .
53
10
161,291
public static WorkClassifier getWorkClassifier ( ) { HttpDispatcher f = instance . get ( ) . get ( ) ; if ( f != null ) return f . workClassifier ; return null ; }
Access to the WorkClassifier
46
6
161,292
private static ObjectName createObjectName ( String type , String name , Hashtable < String , String > props ) { props . put ( KEY_TYPE , type ) ; props . put ( KEY_NAME , name ) ; try { return new ObjectName ( DOMAIN_NAME , props ) ; } catch ( MalformedObjectNameException e ) { throw new IllegalArgumentException ( e ) ; } }
Common object name factory method .
84
6
161,293
public static ObjectName createApplicationObjectName ( String name , String serverName ) { Hashtable < String , String > props = new Hashtable < String , String > ( ) ; props . put ( TYPE_SERVER , serverName ) ; return createObjectName ( TYPE_APPLICATION , name , props ) ; }
Application and module factory methods ...
67
6
161,294
public static ObjectName createEJBModuleObjectName ( String uri , String appName , String serverName ) { return createModuleObjectName ( ModuleType . EJBModule , uri , appName , serverName ) ; }
EJB factory methods ...
48
5
161,295
public static ObjectName createWebModuleObjectName ( String moduleURI , String appName , String serverName ) { return createModuleObjectName ( ModuleType . WebModule , moduleURI , appName , serverName ) ; }
Servlet factory methods ...
46
5
161,296
public static ObjectName createJavaMailObjectName ( String serverName , String mailSessionID , int resourceCounter ) { Hashtable < String , String > props = new Hashtable < String , String > ( ) ; props . put ( TYPE_SERVER , serverName ) ; props . put ( MAIL_SESSION_ID , mailSessionID ) ; props . put ( RESOURCE_ID , TYPE_JAVA_MAIL_RESOURCE + "-" + resourceCounter ) ; ObjectName objectName ; try { objectName = createObjectName ( TYPE_JAVA_MAIL_RESOURCE , NAME_JAVA_MAIL_RESOURCE , props ) ; } catch ( IllegalArgumentException e ) { // mailSessionID contains illegal characters props . remove ( MAIL_SESSION_ID ) ; objectName = createObjectName ( TYPE_JAVA_MAIL_RESOURCE , NAME_JAVA_MAIL_RESOURCE , props ) ; } return objectName ; }
Java mail factory methods ...
213
5
161,297
public static ObjectName createResourceObjectName ( String serverName , String resourceType , String keyName ) { ObjectName objectName ; Hashtable < String , String > props = new Hashtable < String , String > ( ) ; props . put ( TYPE_SERVER , serverName ) ; objectName = createObjectName ( resourceType , keyName , props ) ; return objectName ; }
Creates a Resource ObjectName for a Resource MBean
81
12
161,298
@ Override public boolean libraryExists ( String libraryName ) { FacesContext facesContext = FacesContext . getCurrentInstance ( ) ; String localePrefix = getLocalePrefixForLocateResource ( facesContext ) ; final List < String > contracts = facesContext . getResourceLibraryContracts ( ) ; String pathToLib = null ; Boolean libraryFound = null ; if ( libraryName != null && ! ResourceValidationUtils . isValidLibraryName ( libraryName , isAllowSlashesLibraryName ( ) ) ) { return false ; } if ( localePrefix != null ) { //Check with locale pathToLib = localePrefix + ' ' + libraryName ; libraryFound = getResourceLoaderCache ( ) . libraryExists ( pathToLib ) ; if ( libraryFound != null ) { return libraryFound . booleanValue ( ) ; } } libraryFound = getResourceLoaderCache ( ) . libraryExists ( libraryName ) ; if ( libraryFound != null ) { return libraryFound . booleanValue ( ) ; } if ( localePrefix != null ) { if ( ! contracts . isEmpty ( ) ) { for ( String contract : contracts ) { for ( ContractResourceLoader loader : getResourceHandlerSupport ( ) . getContractResourceLoaders ( ) ) { if ( loader . libraryExists ( pathToLib , contract ) ) { getResourceLoaderCache ( ) . confirmLibraryExists ( pathToLib ) ; return true ; } } } } for ( ResourceLoader loader : getResourceHandlerSupport ( ) . getResourceLoaders ( ) ) { if ( loader . libraryExists ( pathToLib ) ) { getResourceLoaderCache ( ) . confirmLibraryExists ( pathToLib ) ; return true ; } } } //Check without locale if ( ! contracts . isEmpty ( ) ) { for ( String contract : contracts ) { for ( ContractResourceLoader loader : getResourceHandlerSupport ( ) . getContractResourceLoaders ( ) ) { if ( loader . libraryExists ( libraryName , contract ) ) { getResourceLoaderCache ( ) . confirmLibraryExists ( libraryName ) ; return true ; } } } } for ( ResourceLoader loader : getResourceHandlerSupport ( ) . getResourceLoaders ( ) ) { if ( loader . libraryExists ( libraryName ) ) { getResourceLoaderCache ( ) . confirmLibraryExists ( libraryName ) ; return true ; } } if ( localePrefix != null ) { //Check with locale getResourceLoaderCache ( ) . confirmLibraryNotExists ( pathToLib ) ; } else { getResourceLoaderCache ( ) . confirmLibraryNotExists ( libraryName ) ; } return false ; }
Check if a library exists or not . This is done delegating to each ResourceLoader used because each one has a different prefix and way to load resources .
560
31
161,299
public Object setValue ( Token object ) { Object result = value ; value = object ; return result ; }
Sets the value for this entry
22
7