idx
int64 0
165k
| question
stringlengths 73
4.15k
| target
stringlengths 5
918
| len_question
int64 21
890
| len_target
int64 3
255
|
|---|---|---|---|---|
159,000
|
private void addAllEntries ( Set s , com . ibm . wsspi . adaptable . module . Container dir ) throws UnableToAdaptException { for ( Entry entry : dir ) { String path = entry . getPath ( ) ; com . ibm . wsspi . adaptable . module . Container possibleContainer = entry . adapt ( com . ibm . wsspi . adaptable . module . Container . class ) ; //If this container appears to be a directory then we need to add / to the path //If this container is a nested archive, then we add it as-is. if ( possibleContainer != null && ! possibleContainer . isRoot ( ) ) { path = path + "/" ; } s . add ( path ) ; } }
|
Add all entry paths from the Container into the Set
| 161
| 10
|
159,001
|
private void populateCache ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "populateCache" , this ) ; } try { HashMap < String , BaseDestination > destList = _bus . getLWMMEConfig ( ) . getMessagingEngine ( ) . getDestinationList ( ) ; Iterator < Entry < String , BaseDestination > > entries = destList . entrySet ( ) . iterator ( ) ; while ( entries != null && entries . hasNext ( ) ) { Entry < String , BaseDestination > entry = entries . next ( ) ; BaseDestination bd = ( BaseDestination ) entry . getValue ( ) ; if ( bd . isAlias ( ) ) { AliasDestination alias = ( AliasDestination ) bd ; _rawDestinations . add ( alias ) ; BaseDestinationDefinition dd = ( ( JsAdminFactoryImpl ) _jsaf ) . createDestinationAliasDefinition ( alias ) ; addEntry ( _bus . getName ( ) , dd , alias ) ; } else { SIBDestination oo = ( SIBDestination ) entry . getValue ( ) ; _rawDestinations . add ( oo ) ; if ( oo . getDestinationType ( ) == DestinationType . QUEUE ) { LWMConfig queue = oo ; DestinationDefinition dd = ( ( JsAdminFactoryImpl ) _jsaf ) . createDestinationDefinition ( queue ) ; addEntry ( _bus . getName ( ) , dd , queue ) ; } else if ( oo . getDestinationType ( ) == DestinationType . TOPICSPACE ) { LWMConfig topicspace = oo ; DestinationDefinition dd = ( ( JsAdminFactoryImpl ) _jsaf ) . createDestinationDefinition ( topicspace ) ; // Set auditAllowed. // Boolean auditAllowed = (Boolean) tsAuditMap.get(dd.getName()); // if (auditAllowed != null) { // ((DestinationDefinitionImpl) dd).setAuditAllowed(auditAllowed.booleanValue()); // } addEntry ( _bus . getName ( ) , dd , topicspace ) ; } } } // ...end while... } catch ( Exception e ) { SibTr . error ( tc , "POPULATE_DESTINATION_FAILED_SIAS0114" + e ) ; e . printStackTrace ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "populateCache" ) ; } }
|
Build the cache of DestinationDefinition objects in the configuration
| 581
| 10
|
159,002
|
@ Activate protected void activate ( BundleContext ctx , Map < String , Object > properties ) { SibTr . entry ( tc , CLASS_NAME + "activate" , properties ) ; this . properties = properties ; this . bundleLocation = ctx . getBundle ( ) . getLocation ( ) ; populateDestinationPermissions ( ) ; runtimeSecurityService . modifyMessagingServices ( this ) ; SibTr . exit ( tc , CLASS_NAME + "activate" ) ; }
|
Method to activate Messaging Security component
| 102
| 7
|
159,003
|
@ Modified protected void modify ( ComponentContext cc , Map < String , Object > properties ) { SibTr . entry ( tc , CLASS_NAME + "modify" , properties ) ; this . properties = properties ; populateDestinationPermissions ( ) ; runtimeSecurityService . modifyMessagingServices ( this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , CLASS_NAME + "modify" ) ; } }
|
Called by OSGI framework when there is a modification in server . xml for tag associated with this component
| 107
| 21
|
159,004
|
@ Deactivate protected void deactivate ( ComponentContext context ) { SibTr . entry ( tc , CLASS_NAME + "deactivate" , context ) ; runtimeSecurityService . modifyMessagingServices ( null ) ; queuePermissions = null ; topicPermissions = null ; temporaryDestinationPermissions = null ; sibAuthenticationService = null ; sibAuthorizationService = null ; this . bundleLocation = null ; SibTr . exit ( tc , CLASS_NAME + "deactivate" ) ; }
|
Called by OSGI framework when the feature is removed from server . xml
| 107
| 15
|
159,005
|
@ Reference protected void setSecurityService ( SecurityService securityService ) { SibTr . entry ( tc , CLASS_NAME + "setSecurityService" , securityService ) ; this . securityService = securityService ; SibTr . exit ( tc , CLASS_NAME + "setSecurityService" ) ; }
|
Binding Security Service
| 64
| 4
|
159,006
|
protected void unsetSecurityService ( SecurityService securityService ) { SibTr . entry ( tc , CLASS_NAME + "unsetSecurityService" , securityService ) ; SibTr . exit ( tc , CLASS_NAME + "unsetSecurityService" ) ; }
|
Unbinding Security Service
| 57
| 4
|
159,007
|
@ Reference protected void setConfigAdmin ( ConfigurationAdmin configAdmin ) { SibTr . entry ( tc , CLASS_NAME + "setConfigAdmin" , configAdmin ) ; this . configAdmin = configAdmin ; SibTr . exit ( tc , CLASS_NAME + "setConfigAdmin" ) ; }
|
Binding the Configuration Admin service
| 64
| 6
|
159,008
|
protected void unsetConfigAdmin ( ConfigurationAdmin configAdmin ) { SibTr . entry ( tc , CLASS_NAME + "unsetConfigAdmin" , configAdmin ) ; SibTr . exit ( tc , CLASS_NAME + "unsetConfigAdmin" ) ; }
|
Unbinding the Configuration Admin service
| 57
| 6
|
159,009
|
@ Override public MessagingAuthenticationService getMessagingAuthenticationService ( ) { SibTr . entry ( tc , CLASS_NAME + "getMessagingAuthenticationService" ) ; if ( sibAuthenticationService == null ) { sibAuthenticationService = new MessagingAuthenticationServiceImpl ( this ) ; } SibTr . exit ( tc , CLASS_NAME + "getMessagingAuthenticationService" , sibAuthenticationService ) ; return sibAuthenticationService ; }
|
Get Messaging Authentication Service
| 105
| 5
|
159,010
|
@ Override public MessagingAuthorizationService getMessagingAuthorizationService ( ) { SibTr . entry ( tc , CLASS_NAME + "getMessagingAuthorizationService" ) ; if ( sibAuthorizationService == null ) { sibAuthorizationService = new MessagingAuthorizationServiceImpl ( this ) ; } SibTr . exit ( tc , CLASS_NAME + "getMessagingAuthorizationService" , sibAuthorizationService ) ; return sibAuthorizationService ; }
|
Get Messaging Authorization Service
| 105
| 5
|
159,011
|
public UserRegistry getUserRegistry ( ) { SibTr . entry ( tc , CLASS_NAME + "getUserRegistry" ) ; UserRegistry userRegistry = null ; if ( getSecurityService ( ) != null ) { UserRegistryService userRegistryService = securityService . getUserRegistryService ( ) ; try { if ( userRegistryService . isUserRegistryConfigured ( ) ) { userRegistry = userRegistryService . getUserRegistry ( ) ; } else { MessagingSecurityException mse = new MessagingSecurityException ( ) ; FFDCFilter . processException ( mse , CLASS_NAME + ".getUserRegistry" , "1005" , this ) ; SibTr . exception ( tc , mse ) ; SibTr . error ( tc , "USER_REGISTRY_NOT_CONFIGURED_MSE1005" ) ; } } catch ( RegistryException re ) { MessagingSecurityException mse = new MessagingSecurityException ( re ) ; FFDCFilter . processException ( mse , CLASS_NAME + ".getUserRegistry" , "1006" , this ) ; SibTr . exception ( tc , mse ) ; SibTr . error ( tc , "USER_REGISTRY_EXCEPTION_MSE1006" ) ; } } SibTr . exit ( tc , CLASS_NAME + "getUserRegistry" , userRegistry ) ; return userRegistry ; }
|
Get User Registry from the Liberty Security component
| 318
| 8
|
159,012
|
private void populateDestinationPermissions ( ) { SibTr . entry ( tc , CLASS_NAME + "populateDestinationPermissions" , properties ) ; pids . clear ( ) ; String [ ] roles = ( String [ ] ) properties . get ( MessagingSecurityConstants . ROLE ) ; initializeMaps ( ) ; if ( roles != null ) { checkIfRolesAreUnique ( roles ) ; for ( String role : roles ) { Dictionary < String , Object > roleProperties = getDictionaryObject ( role ) ; Set < String > users = null ; Set < String > groups = null ; // Get the list of Users users = createUserOrGroupSet ( roleProperties , MessagingSecurityConstants . USER ) ; // Get the list of Groups groups = createUserOrGroupSet ( roleProperties , MessagingSecurityConstants . GROUP ) ; if ( roleProperties != null ) { populateQueuePermissions ( roleProperties , users , groups ) ; populateTemporarayDestinationPermissions ( roleProperties , users , groups ) ; populateTopicPermissions ( roleProperties , users , groups ) ; } } } if ( tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , CLASS_NAME + " ***** Queue Permissions *****" ) ; printDestinationPermissions ( queuePermissions ) ; SibTr . debug ( tc , CLASS_NAME + " ***** Topic Permissions *****" ) ; printDestinationPermissions ( topicPermissions ) ; SibTr . debug ( tc , CLASS_NAME + " ***** Temporary DestinationPermissions *****" ) ; printDestinationPermissions ( temporaryDestinationPermissions ) ; } SibTr . exit ( tc , CLASS_NAME + "populateDestinationPermissions" ) ; }
|
Populate the DestinationPermissions map with the destination and there access list
| 384
| 14
|
159,013
|
private Dictionary < String , Object > getDictionaryObject ( String input ) { SibTr . entry ( tc , CLASS_NAME + "getDictionaryObject" , input ) ; Dictionary < String , Object > dictionary = null ; Configuration config = null ; try { pids . add ( input ) ; config = configAdmin . getConfiguration ( input , bundleLocation ) ; } catch ( IOException e ) { MessagingSecurityException mse = new MessagingSecurityException ( e ) ; FFDCFilter . processException ( mse , CLASS_NAME + ".getDictionaryObject" , "1008" , this ) ; SibTr . exception ( tc , mse ) ; SibTr . error ( tc , "IO_EXCEPTION_READING_CONFIGURATION_MSE1008" ) ; return new Hashtable < String , Object > ( ) ; } dictionary = config . getProperties ( ) ; SibTr . exit ( tc , CLASS_NAME + "getDictionaryObject" , dictionary ) ; return dictionary ; }
|
Get the Dictionary object for the given String
| 221
| 8
|
159,014
|
private void printDestinationPermissions ( Map < String , ? > destinationPermissions ) { Set < String > destinations = destinationPermissions . keySet ( ) ; for ( String destination : destinations ) { SibTr . debug ( tc , CLASS_NAME + " Destination: " + destination ) ; Permission permission = ( Permission ) destinationPermissions . get ( destination ) ; SibTr . debug ( tc , " Users having permissions!!!" ) ; Map < String , Set < String > > userRoles = permission . getRoleToUserMap ( ) ; Set < String > uRoles = userRoles . keySet ( ) ; for ( String role : uRoles ) { SibTr . debug ( tc , " " + role + ": " + userRoles . get ( role ) ) ; } SibTr . debug ( tc , " Groups having permissions!!!" ) ; Map < String , Set < String > > groupRoles = permission . getRoleToGroupMap ( ) ; Set < String > gRoles = groupRoles . keySet ( ) ; for ( String role : gRoles ) { SibTr . debug ( tc , " " + role + ": " + groupRoles . get ( role ) ) ; } } }
|
Print the Destination Permissions it will be used for debugging purpose
| 269
| 12
|
159,015
|
public static final RecoveryProcessor getInstance ( ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getInstance" ) ; } if ( _processor == null ) { try { Class c = Class . forName ( "com.ibm.ws.sib.processor.impl.RecoveryProcessorImpl" ) ; _processor = ( RecoveryProcessor ) c . newInstance ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } if ( tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "getMBean" , _processor ) ; } return _processor ; }
|
Returns a reference to the singleton RecoveryProcessor .
| 147
| 11
|
159,016
|
protected void init ( int code , String phrase , boolean isError ) { this . myPhrase = phrase ; this . myPhraseBytes = HttpChannelUtils . getEnglishBytes ( phrase ) ; this . myIntCode = code ; if ( isError ) { this . myError = new HttpError ( code , this . myPhrase ) ; } initSpecialArrays ( ) ; checkForAllowedBody ( ) ; }
|
Initialize this status code with the input information .
| 93
| 10
|
159,017
|
public static StatusCodes makeUndefinedValue ( int value ) { StatusCodes code = new StatusCodes ( StatusCodes . UNDEF ) ; code . name = Integer . toString ( value ) ; code . byteArray = HttpChannelUtils . getEnglishBytes ( code . getName ( ) ) ; code . myIntCode = value ; code . initSpecialArrays ( ) ; code . checkForAllowedBody ( ) ; code . hashcode = code . ordinal + code . name . hashCode ( ) ; code . undefined = true ; return code ; }
|
Make a new Undefined enumerated value with the given input .
| 123
| 13
|
159,018
|
protected void initSpecialArrays ( ) { int len = getByteArray ( ) . length ; // set up the "status code + SPACE + default reason phrase" this . bytesWithPhrase = new byte [ len + 1 + this . myPhraseBytes . length ] ; System . arraycopy ( getByteArray ( ) , 0 , this . bytesWithPhrase , 0 , len ) ; this . bytesWithPhrase [ len ] = BNFHeaders . SPACE ; System . arraycopy ( this . myPhraseBytes , 0 , this . bytesWithPhrase , len + 1 , this . myPhraseBytes . length ) ; }
|
Initialize the special arrays .
| 136
| 6
|
159,019
|
public static StatusCodes getByOrdinal ( int i ) { if ( 0 > i || i >= MAX_CODE ) { throw new IndexOutOfBoundsException ( "Index " + i + " is out of bounds" ) ; } return statusCodes [ i ] ; }
|
Query the enumerated value that exists with the specified ordinal value .
| 61
| 14
|
159,020
|
public synchronized static void addBundleRepository ( String installDir , String featureType ) { BundleRepositoryHolder bundleRepositoryHolder = new BundleRepositoryHolder ( installDir , cacheServerName , featureType ) ; if ( ! repositoryHolders . containsKey ( featureType ) ) repositoryHolders . put ( featureType , bundleRepositoryHolder ) ; }
|
Add a bundle repository to the map if one for that feature type has not already been added .
| 79
| 19
|
159,021
|
public Object put ( Object key , Object value ) { if ( null == key ) throw new IllegalArgumentException ( "key must not be null" ) ; if ( ! ( key instanceof String ) ) throw new IllegalArgumentException ( "key must be a String" ) ; if ( ! isValidObject ( value ) ) { if ( value != null ) { throw new IllegalArgumentException ( "Invalid type of value. Type: [" + value . getClass ( ) . getName ( ) + "] with value: [" + value . toString ( ) + "]" ) ; } else { throw new IllegalArgumentException ( "Invalid type of value." ) ; } } /** * Only put it in the ordering list if it isn't already present. */ if ( ! this . containsKey ( key ) ) { this . order . add ( key ) ; } return super . put ( key , value ) ; }
|
Method to put a JSON able object into the instance . Note that the order of initial puts controls the order of serialization . Meaning that the first time an item is put into the object determines is position of serialization . Subsequent puts with the same key replace the existing entry value and leave serialization position alone . For moving the position the object must be removed then re - put .
| 194
| 77
|
159,022
|
public Object remove ( Object key ) { Object retVal = null ; if ( null == key ) throw new IllegalArgumentException ( "key must not be null" ) ; if ( this . containsKey ( key ) ) { retVal = super . remove ( key ) ; for ( int i = 0 ; i < this . order . size ( ) ; i ++ ) { Object obj = this . order . get ( i ) ; if ( obj . equals ( key ) ) { this . order . remove ( i ) ; break ; } } } return retVal ; }
|
Method to remove an entry from the OrderedJSONObject instance .
| 119
| 13
|
159,023
|
private static int getAvailableProcessorsFromFilesystem ( ) { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; Double availableProcessorsDouble = null ; int availableProcessorsInt = - 1 ; //Check for docker files String periodFileLocation = File . separator + "sys" + File . separator + "fs" + File . separator + "cgroup" + File . separator + "cpu" + File . separator + "cpu.cfs_period_us" ; String quotaFileLocation = File . separator + "sys" + File . separator + "fs" + File . separator + "cgroup" + File . separator + "cpu" + File . separator + "cpu.cfs_quota_us" ; File cfsPeriod = new File ( periodFileLocation ) ; File cfsQuota = new File ( quotaFileLocation ) ; if ( cfsPeriod . exists ( ) && cfsQuota . exists ( ) ) { //Found docker files //Read quota try { String quotaContents = readFile ( cfsQuota ) ; double quotaFloat = new Double ( quotaContents ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "quotaFloat = " + quotaFloat ) ; if ( quotaFloat >= 0 ) { //Read period String periodContents = readFile ( cfsPeriod ) ; double periodFloat = new Double ( periodContents ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "periodFloat = " + periodFloat ) ; if ( periodFloat != 0 ) { availableProcessorsDouble = quotaFloat / periodFloat ; availableProcessorsDouble = roundToTwoDecimalPlaces ( availableProcessorsDouble ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Calculated availableProcessors: " + availableProcessorsDouble + ". period=" + periodFloat + ", quota=" + quotaFloat ) ; } } } catch ( Throwable e ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Caught exception: " + e . getMessage ( ) + ". Using number of processors reported by java" ) ; availableProcessorsDouble = null ; } } else { if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Files " + quotaFileLocation + " : " + cfsQuota . exists ( ) ) ; Tr . debug ( tc , "Files " + periodFileLocation + " : " + cfsPeriod . exists ( ) ) ; } } availableProcessorsInt = ( availableProcessorsDouble == null ) ? - 1 : availableProcessorsDouble . intValue ( ) ; // make sure any z.xy cpu quota was not rounded down (especially to 0 ...) during int conversion if ( availableProcessorsDouble != null && availableProcessorsDouble > availableProcessorsInt ) availableProcessorsInt ++ ; return availableProcessorsInt ; }
|
utility below parses cpu limits info from Docker files
| 659
| 11
|
159,024
|
public static void processAllEntryProbeExtensions ( Event event , RequestContext requestContext ) { if ( event == requestContext . getRootEvent ( ) ) { // Add the request to Active Request list requestContext . setRequestContextIndex ( activeRequests . add ( requestContext ) ) ; } List < ProbeExtension > probeExtnList = RequestProbeService . getProbeExtensions ( ) ; for ( int i = 0 ; i < probeExtnList . size ( ) ; i ++ ) { ProbeExtension probeExtension = probeExtnList . get ( i ) ; try { // Entry enabled?? if ( probeExtension . invokeForEventEntry ( ) ) { // To be sampled ?? if ( requestContext . getRequestId ( ) . getSequenceNumber ( ) % probeExtension . getRequestSampleRate ( ) == 0 ) { if ( event == requestContext . getRootEvent ( ) && probeExtension . invokeForRootEventsOnly ( ) == true && ( probeExtension . invokeForEventTypes ( ) == null || probeExtension . invokeForEventTypes ( ) . contains ( event . getType ( ) ) ) ) { probeExtension . processEntryEvent ( event , requestContext ) ; } if ( probeExtension . invokeForRootEventsOnly ( ) == false && ( probeExtension . invokeForEventTypes ( ) == null || probeExtension . invokeForEventTypes ( ) . contains ( event . getType ( ) ) ) ) { probeExtension . processEntryEvent ( event , requestContext ) ; } } } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "----------------Probe extension invocation failure---------------" ) ; Tr . debug ( tc , probeExtension . getClass ( ) . getName ( ) + ".processEntryEvent failed because of the following reason:" ) ; Tr . debug ( tc , e . getMessage ( ) ) ; } FFDCFilter . processException ( e , RequestProbeService . class . getName ( ) + ".processAllEntryProbeExtensions" , "148" ) ; } } }
|
Iterate through all the probe extensions and process all the entry method of the available probe extension
| 464
| 18
|
159,025
|
public static void processAllExitProbeExtensions ( Event event , RequestContext requestContext ) { List < ProbeExtension > probeExtnList = RequestProbeService . getProbeExtensions ( ) ; for ( int i = 0 ; i < probeExtnList . size ( ) ; i ++ ) { ProbeExtension probeExtension = probeExtnList . get ( i ) ; try { // Exit enabled?? if ( probeExtension . invokeForEventExit ( ) ) { // To be sampled ?? if ( requestContext . getRequestId ( ) . getSequenceNumber ( ) % probeExtension . getRequestSampleRate ( ) == 0 ) { if ( event == requestContext . getRootEvent ( ) && probeExtension . invokeForRootEventsOnly ( ) == true && ( probeExtension . invokeForEventTypes ( ) == null || probeExtension . invokeForEventTypes ( ) . contains ( event . getType ( ) ) ) ) { probeExtension . processExitEvent ( event , requestContext ) ; } if ( probeExtension . invokeForRootEventsOnly ( ) == false && ( probeExtension . invokeForEventTypes ( ) == null || probeExtension . invokeForEventTypes ( ) . contains ( event . getType ( ) ) ) ) { probeExtension . processExitEvent ( event , requestContext ) ; } } } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "----------------Probe extension invocation failure---------------" ) ; Tr . debug ( tc , probeExtension . getClass ( ) . getName ( ) + ".processExitEvent failed because of the following reason:" ) ; Tr . debug ( tc , e . getMessage ( ) ) ; } FFDCFilter . processException ( e , RequestProbeService . class . getName ( ) + ".processAllExitProbeExtensions" , "185" ) ; } } if ( event == requestContext . getRootEvent ( ) ) { // Remove the request from active request list try { RequestContext storedRequestContext = activeRequests . get ( requestContext . getRequestContextIndex ( ) ) ; // 1) Check to handle stale requests. // A long running stale request from the last time the feature was enabled could potentially // end up evicting a valid request that is occupying the same slot in the list. // 2) Also check if the returned request context is null, this can happen when we remove the feature while // a request is executing as we clean up the active requests list and the slot no longer holds a request context. if ( storedRequestContext != null && ( storedRequestContext . getRequestId ( ) == requestContext . getRequestId ( ) ) ) activeRequests . remove ( requestContext . getRequestContextIndex ( ) ) ; } catch ( ArrayIndexOutOfBoundsException e ) { //Do nothing as this can fail for an in-flight request when the feature is disabled //Rational being, the active request list gets reset and this index can no longer be valid. } } }
|
Iterate through all the probe extensions and process all the exit method of the available probe extension
| 656
| 18
|
159,026
|
public static void processAllCounterProbeExtensions ( Event event ) { List < ProbeExtension > probeExtnList = RequestProbeService . getProbeExtensions ( ) ; for ( int i = 0 ; i < probeExtnList . size ( ) ; i ++ ) { ProbeExtension probeExtension = probeExtnList . get ( i ) ; try { //Check if this probe extension is interested in //counter events if ( probeExtension . invokeForCounter ( ) ) { probeExtension . processCounter ( event ) ; } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "----------------Probe extension invocation failure---------------" ) ; Tr . debug ( tc , probeExtension . getClass ( ) . getName ( ) + ".processCounterEvent failed because of the following reason:" ) ; Tr . debug ( tc , e . getMessage ( ) ) ; } FFDCFilter . processException ( e , RequestProbeService . class . getName ( ) + ".processAllCounterProbeExtensions" , "215" ) ; } } }
|
Iterate through all the probe extensions and process the counter methods of interested probe extensions
| 249
| 16
|
159,027
|
@ Reference ( name = KEY_SECURITY_SERVICE , policy = ReferencePolicy . DYNAMIC ) protected void setSecurityService ( SecurityService securitysvc ) { securityService = securitysvc ; }
|
serviceReferences are bad avoid and do this instead .
| 45
| 10
|
159,028
|
public static String getUserName ( ) throws Exception { Subject subject = getRunAsSubjectInternal ( ) ; if ( subject == null ) { return null ; } Set < Principal > principals = subject . getPrincipals ( ) ; Iterator < Principal > principalsIterator = principals . iterator ( ) ; if ( principalsIterator . hasNext ( ) ) { Principal principal = principalsIterator . next ( ) ; return principal . getName ( ) ; } return null ; }
|
Gets the username from the principal of the subject .
| 96
| 11
|
159,029
|
public static synchronized boolean pushSubject ( String username ) { if ( securityService == null || username == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "returning false because user or securityService is null," + " user= " + username + " secsvc= " + securityService ) ; } return false ; } AuthenticationService authenticationService = securityService . getAuthenticationService ( ) ; Subject tempSubject = new Subject ( ) ; Hashtable < String , Object > hashtable = new Hashtable < String , Object > ( ) ; if ( ! authenticationService . isAllowHashTableLoginWithIdOnly ( ) ) { hashtable . put ( AuthenticationConstants . INTERNAL_ASSERTION_KEY , Boolean . TRUE ) ; } hashtable . put ( "com.ibm.wsspi.security.cred.userId" , username ) ; tempSubject . getPublicCredentials ( ) . add ( hashtable ) ; try { Subject new_subject = authenticationService . authenticate ( JaasLoginConfigConstants . SYSTEM_WEB_INBOUND , tempSubject ) ; return setRunAsSubject ( new_subject ) ; } catch ( AuthenticationException e ) { FFDCFilter . processException ( e , TokenPropagationHelper . class . getName ( ) , "pushSubject" , new Object [ ] { username } ) ; Tr . error ( tc , "ERROR_AUTHENTICATE" , new Object [ ] { e . getMessage ( ) } ) ; // CWWKS6103E return false ; } catch ( Exception e ) { FFDCFilter . processException ( e , TokenPropagationHelper . class . getName ( ) , "pushSubject" , new Object [ ] { username } ) ; return false ; } }
|
Authenticate the username create it s Subject and push it on to the thread . It s up to the caller to save off the prior subject and make sure it gets restored and guard against any threading issues .
| 384
| 42
|
159,030
|
public static synchronized boolean setRunAsSubject ( Subject subj ) { Subject before = null ; try { before = getRunAsSubject ( ) ; final Subject fsubj = subj ; AccessController . doPrivileged ( new PrivilegedExceptionAction < Object > ( ) { @ Override public Object run ( ) throws Exception { WSSubject . setRunAsSubject ( fsubj ) ; return null ; } } ) ; } catch ( PrivilegedActionException e ) { FFDCFilter . processException ( e , TokenPropagationHelper . class . getName ( ) , "setRunAsSubject" , new Object [ ] { } ) ; return false ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setRunAsSubject, runAsSubject before = " , before ) ; Tr . debug ( tc , "setRunAsSubject, runAsSubject after = " , subj ) ; } return true ; }
|
set the runAsSubject . Contain any exceptions with FFDC .
| 202
| 14
|
159,031
|
public static TopicWildcardTranslation getInstance ( ) throws Exception { if ( tcInt . isEntryEnabled ( ) ) Tr . entry ( tcInt , "getInstance" ) ; if ( twt == null ) { try { Class cls = Class . forName ( UtConstants . TWT_FACTORY_CLASS ) ; twt = ( TopicWildcardTranslation ) cls . newInstance ( ) ; } catch ( InstantiationException ie ) { // No FFDC code needed if ( tcInt . isDebugEnabled ( ) ) Tr . debug ( tcInt , "Unable to instantiate TopicWildcardTranslation" , ie ) ; if ( tcInt . isEntryEnabled ( ) ) Tr . exit ( tcInt , "getInstance" ) ; twt = null ; throw ie ; } } if ( tcInt . isEntryEnabled ( ) ) Tr . exit ( tcInt , "getInstance" ) ; return twt ; }
|
Obtain the singleton instance of the wildcard mapping class .
| 198
| 13
|
159,032
|
public static VersionRange getFilterRange ( FilterVersion minVersion , FilterVersion maxVersion ) { VersionRange vr = null ; Version vmin = minVersion == null ? Version . emptyVersion : new Version ( minVersion . getValue ( ) ) ; Version vmax = maxVersion == null ? null : new Version ( maxVersion . getValue ( ) ) ; char leftType = ( minVersion == null || minVersion . getInclusive ( ) ) ? VersionRange . LEFT_CLOSED : VersionRange . LEFT_OPEN ; char rightType = ( maxVersion == null || maxVersion . getInclusive ( ) ) ? VersionRange . RIGHT_CLOSED : VersionRange . RIGHT_OPEN ; vr = new VersionRange ( leftType , vmin , vmax , rightType ) ; return vr ; }
|
This method creates a version range from the supplied min and max FilterVersion
| 174
| 14
|
159,033
|
public boolean update ( File directory , String fileName , String fileExtension , int maxFiles ) { this . maxFiles = maxFiles ; boolean updateLocation = ! directory . equals ( this . directory ) || ! fileName . equals ( this . fileName ) || ! fileExtension . equals ( this . fileExtension ) ; if ( updateLocation ) { this . directory = directory ; this . fileName = fileName ; this . fileExtension = fileExtension ; filePattern = LoggingFileUtils . compileLogFileRegex ( fileName , fileExtension ) ; // The location was updated, so remove our list of cached files. files = null ; } if ( maxFiles <= 0 ) { files = null ; } else { if ( files == null ) { files = new ArrayList < String > ( ) ; // Sort and add all existing files. String [ ] existing = LoggingFileUtils . safelyFindFiles ( directory , filePattern ) ; if ( existing != null ) { Arrays . sort ( existing , NaturalComparator . instance ) ; files . addAll ( Arrays . asList ( existing ) ) ; } } // Delete excess old files if necessary. int maxTrackedFiles = getMaxDateFiles ( ) ; while ( files . size ( ) > maxTrackedFiles ) { removeFile ( 0 ) ; } // If the location was updated, initialize the counter from the // remaining files (if any). if ( updateLocation ) { if ( files . isEmpty ( ) ) { lastDateString = null ; } else { Matcher matcher = filePattern . matcher ( files . get ( files . size ( ) - 1 ) ) ; if ( ! matcher . matches ( ) ) throw new IllegalStateException ( ) ; lastDateString = matcher . group ( 1 ) ; lastCounter = Integer . parseInt ( matcher . group ( 2 ) ) ; } } } return updateLocation ; }
|
Updates the configuration for this set of logs .
| 407
| 10
|
159,034
|
private void addFile ( int index , String file ) { if ( maxFiles > 0 ) { int numFiles = files . size ( ) ; int maxDateFiles = getMaxDateFiles ( ) ; // If there is no max or we have fewer than max, then we're done. if ( maxDateFiles <= 0 || numFiles < maxDateFiles ) { files . add ( index , file ) ; } else { // The file names we deal with (messages_xx.xx.xx_xx.xx.xx.log) // have dates, and we want to always be using the "most recent", // so delete everything "newer" (index and after), which might be // present if the system clock goes backwards, and then delete // the oldest files until only maxDateFiles-1 remain. while ( files . size ( ) > index ) { removeFile ( files . size ( ) - 1 ) ; } while ( files . size ( ) >= maxDateFiles ) { removeFile ( 0 ) ; } files . add ( file ) ; } } }
|
Adds a file name to the files list at the specified index . If adding this file would cause the number of files to exceed the maximum remove all files after the specified index and then remove the oldest files until the number is reduced to the maximum .
| 224
| 49
|
159,035
|
protected JsJmsMessage instantiateMessage ( ) throws Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "instantiateMessage" ) ; // Create a new message object. JsJmsMessage newMsg = jmfact . createJmsMessage ( ) ; messageClass = CLASS_NONE ; // d317373 default the MSG_TYPE to be DATAGRAM until setReplyTo is called newMsg . setNonNullProperty ( ApiJmsConstants . MSG_TYPE_PROPERTY , Integer . valueOf ( ApiJmsConstants . MQMT_DATAGRAM ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "instantiateMessage" , newMsg ) ; return newMsg ; }
|
This method carries out the instantiation of the MFP message object for this JMS message class . The method is overridden by subclasses to instantiate the correct subclass and carry out any reference setting required .
| 201
| 42
|
159,036
|
protected JsJmsMessage getMsgReference ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getMsgReference" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getMsgReference" , msg ) ; return msg ; }
|
Get a Jetstream message representing the content of this JMS message . Used during the sending of messages .
| 98
| 21
|
159,037
|
protected void setDestReference ( Destination d ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setDestReference" , d ) ; dest = d ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setDestReference" ) ; }
|
Update the destination cache reference without setting any data into the core message .
| 91
| 14
|
159,038
|
protected void checkBodyWriteable ( String callingMethodName ) throws JMSException { if ( bodyReadOnly ) { throw ( javax . jms . MessageNotWriteableException ) JmsErrorUtils . newThrowable ( javax . jms . MessageNotWriteableException . class , "READ_ONLY_MESSAGE_BODY_CWSIA0107" , new Object [ ] { callingMethodName } , tc ) ; } }
|
If the message body is read - only throw a MessageNotWriteableException .
| 100
| 16
|
159,039
|
protected void checkBodyReadable ( String callingMethodName ) throws MessageNotReadableException { if ( ! bodyReadOnly ) { throw ( javax . jms . MessageNotReadableException ) JmsErrorUtils . newThrowable ( javax . jms . MessageNotReadableException . class , "WRITE_ONLY_MESSAGE_BODY_CWSIA0109" , new Object [ ] { callingMethodName } , tc ) ; } }
|
If the message body is write - only throw a MessageNotReadableException .
| 104
| 16
|
159,040
|
protected void checkPropertiesWriteable ( String callingMethodName ) throws JMSException { if ( propertiesReadOnly ) { throw ( javax . jms . MessageNotWriteableException ) JmsErrorUtils . newThrowable ( javax . jms . MessageNotWriteableException . class , "READ_ONLY_MESSAGE_PROPERTY_CWSIA0108" , new Object [ ] { callingMethodName } , tc ) ; } }
|
If the message properties are read - only throw a MessageNotWriteableException .
| 102
| 16
|
159,041
|
public Reliability getReliability ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getReliability" ) ; Reliability r = msg . getReliability ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getReliablity" , r ) ; return r ; }
|
This method retrieves the underlying reliability that is set for this message . The outgoing value can also be determined by examining the persistence and NPM properties however inbound cannot be found in this way .
| 105
| 39
|
159,042
|
protected void setBodyReadOnly ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setBodyReadOnly" ) ; bodyReadOnly = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setBodyReadOnly" ) ; }
|
Mark the body of the message as read only . Needed for the reset methods of Bytes and Stream messages .
| 94
| 23
|
159,043
|
void clearLocalProperties ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "clearLocalProperties" ) ; if ( locallyStoredPropertyValues != null ) locallyStoredPropertyValues . clear ( ) ; // d255144 Also clear the local version of the messageID localJMSMessageID = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "clearLocalProperties" ) ; }
|
Clear special case properties held in this message . Invoked at send time .
| 128
| 15
|
159,044
|
void invalidateToStringCache ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "invalidateToStringCache" ) ; // Invalidate the toString cache. cachedToString = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "invalidateToStringCache" ) ; }
|
Called by the sendMessage method of JmsMsgProducerImpl in order to invalidate the toString of the message when we send it .
| 106
| 30
|
159,045
|
static void checkPropName ( String name , String callingMethodName ) throws IllegalArgumentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkPropName" , new Object [ ] { name , callingMethodName } ) ; if ( ( name == null ) || ( "" . equals ( name ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Invalid field name: " + name + " as parameter to " + callingMethodName ) ; throw ( IllegalArgumentException ) JmsErrorUtils . newThrowable ( IllegalArgumentException . class , "INVALID_FIELD_NAME_CWSIA0106" , null , // no inserts for CWSIA0106 tc ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkPropName" ) ; }
|
This method checks the property name to see whether it is null or empty and throws an IllegalArgumentException if it is . Note that this is used from MapMessage for the body as well as from this class for the header .
| 227
| 46
|
159,046
|
public String getDatabasePlatformClassName ( PUInfoImpl pui ) { SessionLog traceLogger = new TraceLog ( ) ; Properties properties = pui . getProperties ( ) ; String productName = properties . getProperty ( PersistenceUnitProperties . SCHEMA_DATABASE_PRODUCT_NAME ) ; String vendorNameAndVersion = null ; // check persistent properties if ( productName != null ) { vendorNameAndVersion = productName ; String majorVersion = properties . getProperty ( PersistenceUnitProperties . SCHEMA_DATABASE_MAJOR_VERSION ) ; if ( majorVersion != null ) { vendorNameAndVersion += majorVersion ; String minorVersion = properties . getProperty ( PersistenceUnitProperties . SCHEMA_DATABASE_MINOR_VERSION ) ; if ( minorVersion != null ) { vendorNameAndVersion += minorVersion ; } } } else { vendorNameAndVersion = getVendorNameAndVersion ( pui . getJtaDataSource ( ) ) ; if ( vendorNameAndVersion == null ) { getVendorNameAndVersion ( pui . getNonJtaDataSource ( ) ) ; } } return DBPlatformHelper . getDBPlatform ( vendorNameAndVersion , traceLogger ) ; }
|
Returns the EclipseLink database platform class name based on the properties passed in or by detecting it through the connection if one is available .
| 268
| 26
|
159,047
|
@ FFDCIgnore ( SQLException . class ) private Boolean supportsUnicodeStaticCheck ( DataSource ds ) { Boolean res = null ; try { Connection conn = ds . getConnection ( ) ; String product = null ; try { DatabaseMetaData dmd = conn . getMetaData ( ) ; product = dmd . getDatabaseProductName ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "supportsUnicodeStaticCheck : getDatabaseProductName = " + product ) ; } } finally { conn . close ( ) ; } for ( Pattern supportedPattern : _unicodeSupportPlatform ) { if ( supportedPattern . matcher ( product ) . matches ( ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "matched _unicodeSupportPlatform=" + supportedPattern . pattern ( ) ) ; } return Boolean . TRUE ; } } for ( Pattern unsupported : _noUnicodeSupportPlatform ) { if ( unsupported . matcher ( product ) . matches ( ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "matched _noUnicodeSupportPlatform=" + unsupported . pattern ( ) ) ; } return Boolean . FALSE ; } } } catch ( SQLException e ) { // Unexpected if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Something went wrong in supportsUnicodeStaticCheck() -- " , e ) ; } } return res ; }
|
Consults the static collections contained within this class and attempts to determine whether the provided DataSource supports unicode .
| 323
| 22
|
159,048
|
public void setMessagingAuthorizationService ( MessagingAuthorizationService messagingAuthorizationService ) { SibTr . entry ( tc , CLASS_NAME + "setMessagingAuthorizationService" , messagingAuthorizationService ) ; this . messagingAuthorizationService = messagingAuthorizationService ; SibTr . exit ( tc , CLASS_NAME + "setMessagingAuthorizationService" ) ; }
|
Set the Messaging Authorization Service
| 82
| 6
|
159,049
|
@ Override public void destroy ( ) throws Exception { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "destroy" , id ) ; tracker . close ( ) ; StringBuilder filter = new StringBuilder ( FilterUtils . createPropertyFilter ( AbstractConnectionFactoryService . ID , id ) ) ; filter . insert ( filter . length ( ) - 1 , ' ' ) ; builder . removeExistingConfigurations ( filter . toString ( ) ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "destroy" ) ; }
|
Destroy this application - defined resource by removing its configuration and the configuration of all other services that were created for it .
| 144
| 23
|
159,050
|
public void addMPDestinationChangeListener ( MPDestinationChangeListener destinationChangeListener ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addMPDestinationChangeListener" , new Object [ ] { destinationChangeListener } ) ; _destinationChangeListeners . add ( destinationChangeListener ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addMPDestinationChangeListener" ) ; }
|
This method is used internal to MP only and is used to register additional destination change listeners that are need as well as the main MP listener registered at startup .
| 125
| 31
|
159,051
|
public void removeMPDestinationChangeListener ( MPDestinationChangeListener destinationChangeListener ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeMPDestinationChangeListener" , new Object [ ] { destinationChangeListener } ) ; _destinationChangeListeners . remove ( destinationChangeListener ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeMPDestinationChangeListener" ) ; }
|
This method is used internal to MP only and is used to remove a destination change listener that was registered . This method will only remove a destinationLocationChangeListener that was registered via addMPDestinationChangeListener
| 125
| 42
|
159,052
|
private Set getDestinationLocalitySet ( BaseDestinationHandler destinationHandler , Capability capability ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getDestinationLocalitySet" , new Object [ ] { destinationHandler , capability } ) ; // Check if the localisation should be deleted Set localitySet = null ; //Get the locality sets as known by admin try { localitySet = _messageProcessor . getSIBDestinationLocalitySet ( null , destinationHandler . getUuid ( ) . toString ( ) , true ) ; } catch ( SIBExceptionBase e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.DestinationChangeListener.getDestinationLocalitySet" , "1:368:1.45" , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getDestinationLocalitySet" , localitySet ) ; return localitySet ; }
|
Retrieve the Locality Set defined in Admin .
| 244
| 10
|
159,053
|
private void cleanupDestination ( PtoPMessageItemStream ptoPMessageItemStream , BaseDestinationHandler destinationHandler , SIBUuid8 meUuid , Capability capability ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "cleanupDestination" , new Object [ ] { ptoPMessageItemStream , destinationHandler , meUuid , capability } ) ; // The localisation is not known in WCCM or WLM, so mark it for deletion try { ptoPMessageItemStream . markAsToBeDeleted ( _txManager . createAutoCommitTransaction ( ) ) ; //Capability == GET Close any remote consumers from the destination destinationHandler . closeRemoteConsumer ( meUuid ) ; } catch ( SIResourceException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.DestinationChangeListener.cleanupDestination" , "1:424:1.45" , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "cleanupDestination" ) ; }
|
Cleanup destinations unknown to both WLM and WCCM .
| 273
| 13
|
159,054
|
private void compareToAparList ( ExecutionContext context , CommandConsole console , Map < String , Set < String > > installedIFixes , File wlpInstallationDirectory ) { // console.printlnInfoMessage("WLP Directory [ " + wlpInstallationDirectory.getPath() + " ]"); // console.printlnInfoMessage("Installed IFixes [ " + installedIFixes.keySet() + " ]"); // First grab the apar list String aparListString = context . getOptionValue ( APAR_TO_COMPARE_OPTION ) ; List < String > aparList ; // Service 83179: String.split yields a singleton list on an empty string! aparListString = aparListString . trim ( ) ; if ( aparListString . isEmpty ( ) ) { aparList = Collections . emptyList ( ) ; } else { // Service 83179: Trim spaces and duplicates; delimit on space and tab, too. aparList = new ArrayList < String > ( ) ; String [ ] aparListArray = aparListString . split ( ",| |\t" ) ; for ( String apar : aparListArray ) { apar = apar . trim ( ) ; if ( ! apar . isEmpty ( ) && ! aparList . contains ( apar ) ) { aparList . add ( apar ) ; } } } // console.printlnInfoMessage("APAR List String [ " + aparListString + " ]"); // console.printlnInfoMessage("APAR List [ " + Arrays.toString(aparList) + " ]"); // We now know what APARs to look for so load which ones are installed from both iFixes and Fix Packs Set < String > aparsInstalled = null ; try { aparsInstalled = findFixPackAparIds ( wlpInstallationDirectory , console , context ) ; } catch ( IllegalArgumentException e ) { // These are thrown by the methods when the inputs were invalid and should have the message set to something readable to the user console . printlnErrorMessage ( e . getMessage ( ) ) ; return ; } catch ( ZipException e ) { console . printlnErrorMessage ( getMessage ( "compare.error.reading.install" , wlpInstallationDirectory , e . getMessage ( ) ) ) ; return ; } catch ( IOException e ) { console . printlnErrorMessage ( getMessage ( "compare.error.reading.install" , wlpInstallationDirectory , e . getMessage ( ) ) ) ; return ; } // console.printlnInfoMessage("Installed APARs [ " + aparsInstalled + " ]"); aparsInstalled . addAll ( installedIFixes . keySet ( ) ) ; // Service 83179: Use a list: Keep the missing APARs in the order as originally specified. List < String > missingApars = new ArrayList < String > ( ) ; for ( String apar : aparList ) { if ( ! aparsInstalled . contains ( apar ) ) { missingApars . add ( apar ) ; } } // console.printlnInfoMessage("Missing APARS [ " + missingApars.size() + " ] [ " + missingApars + " ]"); if ( missingApars . isEmpty ( ) ) { // Output a message saying all APARs were present console . printlnInfoMessage ( getMessage ( "compare.all.apars.present" ) ) ; } else { // Output a message saying which APARs were missing console . printlnInfoMessage ( getMessage ( "compare.missing.apars" , missingApars . toString ( ) ) ) ; } }
|
Compares the current install to a list of APARs in the console arguments
| 795
| 16
|
159,055
|
private void compareToInstallLocation ( ExecutionContext context , CommandConsole console , Map < String , Set < String > > aparToIFixMap , File wlpInstallationDirectory ) { String installToCompareToLocation = context . getOptionValue ( INSTALL_LOCATION_TO_COMPARE_TO_OPTION ) ; File installToCompareToFile = new File ( installToCompareToLocation ) ; if ( ! installToCompareToFile . exists ( ) ) { console . printlnErrorMessage ( getMessage ( "compare.to.option.does.not.exist" , installToCompareToLocation ) ) ; return ; } Set < String > aparsForNewInstall = null ; try { aparsForNewInstall = findFixPackAparIds ( installToCompareToFile , console , context ) ; } catch ( IllegalArgumentException e ) { // These are thrown by the methods when the inputs were invalid and should have the message set to something readable to the user console . printlnErrorMessage ( e . getMessage ( ) ) ; return ; } catch ( ZipException e ) { console . printlnErrorMessage ( getMessage ( "compare.error.reading.install" , installToCompareToLocation , e . getMessage ( ) ) ) ; return ; } catch ( IOException e ) { console . printlnErrorMessage ( getMessage ( "compare.error.reading.install" , installToCompareToLocation , e . getMessage ( ) ) ) ; return ; } // Go through all of the APARs that are currently installed and make sure they are in the new version Map < String , Set < String > > missingApars = new HashMap < String , Set < String > > ( ) ; for ( Map . Entry < String , Set < String > > aparIFixInfo : aparToIFixMap . entrySet ( ) ) { String apar = aparIFixInfo . getKey ( ) ; if ( ! aparsForNewInstall . contains ( apar ) ) { missingApars . put ( apar , aparIFixInfo . getValue ( ) ) ; } } // Output the result, this will consist of a message saying if there were any missing iFixes then details on what was missing and what was included if ( missingApars . isEmpty ( ) ) { console . printlnInfoMessage ( getMessage ( "compare.all.ifixes.present" , wlpInstallationDirectory . getAbsolutePath ( ) , installToCompareToLocation ) ) ; } else { console . printlnInfoMessage ( getMessage ( "compare.ifixes.missing" , wlpInstallationDirectory . getAbsolutePath ( ) , installToCompareToLocation ) ) ; console . printlnInfoMessage ( "" ) ; console . printlnInfoMessage ( getMessage ( "compare.list.missing.ifixes" , wlpInstallationDirectory . getAbsolutePath ( ) , installToCompareToLocation ) ) ; printAparIFixInfo ( console , missingApars ) ; } // Now print the included APARs by removing all of the missing ones for ( String missingApar : missingApars . keySet ( ) ) { aparToIFixMap . remove ( missingApar ) ; } if ( ! aparToIFixMap . isEmpty ( ) ) { console . printlnInfoMessage ( "" ) ; console . printlnInfoMessage ( getMessage ( "compare.list.included.ifixes" , wlpInstallationDirectory . getAbsolutePath ( ) , installToCompareToLocation ) ) ; printAparIFixInfo ( console , aparToIFixMap ) ; } }
|
Compares the current install to one supplied in the console arguments
| 773
| 12
|
159,056
|
private void printAparIFixInfo ( CommandConsole console , Map < String , Set < String > > aparToIFixMap ) { for ( Map . Entry < String , Set < String > > aparIFixInfo : aparToIFixMap . entrySet ( ) ) { console . printlnInfoMessage ( getMessage ( "compare.ifix.apar.info" , aparIFixInfo . getKey ( ) , aparIFixInfo . getValue ( ) ) ) ; } }
|
This will print the map of APARs to iFixes by giving a line to each APAR listing which iFixes it is in
| 109
| 29
|
159,057
|
private Version getProductVersion ( File wlpInstallationDirectory ) throws VersionParsingException { // First get the properties Map < String , ProductInfo > productProperties = VersionUtils . getAllProductInfo ( wlpInstallationDirectory ) ; // Get the properties for WAS ProductInfo wasProperties = productProperties . get ( "com.ibm.websphere.appserver" ) ; if ( wasProperties == null ) { throw new VersionParsingException ( getMessage ( "compare.no.was.properties.found" ) ) ; } Version version = convertVersion ( wasProperties ) ; return version ; }
|
Gets the product version from the properties file for the com . ibm . websphere . appserver product
| 134
| 23
|
159,058
|
private String readLine ( InputStream stream ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( stream ) ) ; return reader . readLine ( ) ; }
|
This will read a single line from the input stream as a string .
| 41
| 14
|
159,059
|
public void service ( ServletRequest req , ServletResponse resp ) throws ServletException , IOException { try { TimedServletPoolElement e = _pool . getNextElement ( ) ; e . getServlet ( ) . service ( req , resp ) ; _pool . returnElement ( e ) ; _pool . removeExpiredElements ( ) ; } catch ( Throwable th ) { com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( th , "com.ibm.ws.webcontainer.servlet.SingleThreadModelServlet.service" , "84" , this ) ; throw new ServletErrorReport ( th ) ; } }
|
Overloaded by subclasses to perform the servlet s request handling operation .
| 150
| 15
|
159,060
|
public ModuleItem find ( String name ) { if ( children == null ) return null ; else return ( ModuleItem ) children . get ( name ) ; /* * for(int i=0; i<children.size(); i++) * { * ModuleItem item = (ModuleItem)children.get(i); * if(item.instance != null) * { * if(item.instance.getName().equals(name)) * return item; * } * } * return null; */ }
|
Find an immediate child
| 105
| 4
|
159,061
|
public ModuleItem find ( String [ ] path , int index ) { if ( path == null ) return null ; if ( path . length == 0 ) return this ; ModuleItem item = find ( path [ index ] ) ; if ( item == null ) return null ; if ( index == path . length - 1 ) return item ; else return item . find ( path , index + 1 ) ; }
|
Find a child in the subtree - do it recursively
| 82
| 13
|
159,062
|
public synchronized ModuleItem add ( String [ ] path , int index ) { if ( path == null ) return null ; if ( path . length == 0 ) return this ; ModuleItem item = find ( path [ index ] ) ; // custom module shouldn't go inside if{} if ( item == null ) { // Create Aggregate Module String [ ] myPath = new String [ index + 1 ] ; System . arraycopy ( path , 0 , myPath , 0 , myPath . length ) ; if ( myPath . length == 1 ) { // first layer will have aggregation ModuleAggregate aggregate = new ModuleAggregate ( myPath [ 0 ] ) ; item = find ( path [ index ] ) ; } else if ( myPath . length == 3 ) { // this is supposed to be submdoule layer new ModuleAggregate ( myPath [ 0 ] , myPath [ 1 ] , myPath [ 2 ] ) ; item = find ( path [ index ] ) ; } else { // lower levels will not have aggregation //item = new ModuleItem(new PmiModuleDummyImpl(myPath)); Tr . warning ( tc , "PMI9999E" , "Parent module not found." ) ; } // Add aggregate module to tree add ( item ) ; } if ( index == path . length - 1 ) return item ; else return item . add ( path , index + 1 ) ; }
|
Find and add a child in the subtree if not found - do it recursively
| 292
| 18
|
159,063
|
public ModuleItem [ ] children ( ) { if ( children == null ) return null ; ModuleItem [ ] members = new ModuleItem [ children . size ( ) ] ; children . values ( ) . toArray ( members ) ; return members ; }
|
Return an array of children - synchronized?
| 51
| 8
|
159,064
|
public synchronized void remove ( ModuleItem item ) { if ( item == null || children == null ) return ; // remove from all the parents which have links to it due to aggregate data PmiModule removeInstance = item . getInstance ( ) ; if ( ! ( removeInstance instanceof PmiModuleAggregate ) ) { // recursively remove aggregate data for parents ModuleItem myParent = this ; PmiModule parModule = null ; while ( myParent != null ) { parModule = myParent . getInstance ( ) ; // if parent is aggregate if ( parModule != null && parModule instanceof PmiModuleAggregate ) ( ( PmiModuleAggregate ) parModule ) . remove ( removeInstance ) ; myParent = myParent . getParent ( ) ; } } // remove any children item . _cleanChildren ( ) ; // remove ModuleItem children . remove ( item . getInstance ( ) . getName ( ) ) ; if ( myStatsWithChildren != null ) { updateStatsTree ( ) ; } //bStatsTreeNeedsUpdate = true; // remove mbean mapping and deactivate any CustomStats mbean //_cleanMBean(item); item . getInstance ( ) . cleanup ( ) ; item = null ; }
|
Remove a child from it - synchronized
| 260
| 7
|
159,065
|
public DataDescriptor [ ] listMembers ( DataDescriptor dd , boolean jmxBased ) { // take care of data members SpdData [ ] dataList = null ; int dataLength = 0 ; if ( ! jmxBased ) { dataList = instance . listData ( ) ; if ( dataList != null ) dataLength = dataList . length ; } // take care of non-data members String [ ] nameList = null ; int itemLength = 0 ; ModuleItem [ ] items = children ( ) ; if ( items != null ) { itemLength = items . length ; nameList = new String [ itemLength ] ; for ( int i = 0 ; i < itemLength ; i ++ ) { String [ ] path = items [ i ] . getInstance ( ) . getPath ( ) ; nameList [ i ] = path [ path . length - 1 ] ; } } // create the returned array // return both item (instance/submodule) descriptor and data descriptor if any if ( itemLength == 0 && dataLength == 0 ) return null ; DataDescriptor [ ] res = new DataDescriptor [ itemLength + dataLength ] ; for ( int i = 0 ; i < itemLength ; i ++ ) { res [ i ] = new DataDescriptor ( dd , nameList [ i ] ) ; } for ( int i = 0 ; i < dataLength ; i ++ ) { res [ i + itemLength ] = new DataDescriptor ( dd , dataList [ i ] . getId ( ) ) ; } return res ; }
|
dd is the DataDescriptor for this module
| 330
| 10
|
159,066
|
public StatsImpl getStats ( boolean recursive ) { // DO THIS METHOD NEED SYNCHRONIZED ACCESS? // When multiple threads get inside the method and stats tree is updated if ( recursive ) { /* * // if leaf then do not create myStatsWithChildren. Instead return myStats * if (children == null && !bStatsTreeNeedsUpdate) * { * // return myStats * if (myStats == null) * { * if (instance != null) * myStats = instance.getStats (instance.listStatistics(), null); * else * myStats = new StatsImpl("server", TYPE_SERVER, level, null, null); * } * * return myStats; * } * else */ // first time here if ( myStatsWithChildren == null ) { ArrayList dataMembers = null ; if ( instance != null ) dataMembers = instance . listStatistics ( ) ; ArrayList colMembers = null ; // return subcollection members // getStats from children ModuleItem [ ] items = children ( ) ; if ( items != null ) { colMembers = new ArrayList ( items . length ) ; for ( int i = 0 ; i < items . length ; i ++ ) { colMembers . add ( items [ i ] . getStats ( recursive ) ) ; } } if ( instance != null ) myStatsWithChildren = instance . getStats ( dataMembers , colMembers ) ; else myStatsWithChildren = new StatsImpl ( "server" , TYPE_SERVER , level , null , colMembers ) ; } else { updateStatisticsForStatsTree ( System . currentTimeMillis ( ) ) ; // update external & aggregate statistics } return myStatsWithChildren ; } // NON-RECURSIVE else { if ( myStats == null ) { if ( instance != null ) myStats = instance . getStats ( instance . listStatistics ( ) , null ) ; else myStats = new StatsImpl ( "server" , TYPE_SERVER , level , null , null ) ; } else { if ( instance != null ) instance . updateStatistics ( ) ; // update external & aggregate statistics myStats . setTime ( System . currentTimeMillis ( ) ) ; } return myStats ; } /* * ArrayList dataMembers = instance.listStatistics(); * ArrayList colMembers = null; // return subcollection members * * if (recursive) * { * ModuleItem[] items = children(); * * // getStats from children * if(items != null) * { * colMembers = new ArrayList(items.length); * for(int i=0; i<items.length; i++) * { * colMembers.add(items[i].getStats(recursive)); * } * } * } * * // return Stats - individual instance will return different XXXStats instance * // Note: construct dataMembers in ModuleItem and pass it to instance * // because getStats will be overwritten by subclasses * // and we don't want to duplicate the same code. * * return instance.getStats(dataMembers, colMembers); */ }
|
is updated .
| 643
| 3
|
159,067
|
private void setInstanceLevel_FG ( int [ ] enabled , int [ ] enabledSync , boolean recursive ) { if ( instance != null ) { // Fine grained instrumentation overrides the old level // First call setFineGrainedInstrumentation. // If fine grained level is undefined called old setInstrumentationLevel boolean action = instance . setFineGrainedInstrumentation ( enabled , enabledSync ) ; /* * not need since PmiConfigManager.updateWithRuntimeSpec is always called before persisting * // Update in-memory EMF object (PMIModule) * // call instance.getEnabled() to save the filtered set (filtering done by setFineGrainedInstrumentation, specifically bean module methods) * if (PmiConfigManager.isInitialized()) * PmiConfigManager.updateSpec(instance.getPath(), instance.getWCCMStatsType(), instance.getEnabled(), instance.getEnabledSync(), false, false); */ // FIXME: updating parent. may need to call this conditionally - when there is a change in fg spec updateParent ( ) ; } if ( recursive ) { ModuleItem [ ] items = children ( ) ; if ( items == null ) return ; for ( int i = 0 ; i < items . length ; i ++ ) { items [ i ] . setInstanceLevel_FG ( enabled , enabledSync , recursive ) ; } } }
|
add data to parent if the newLevel is higher
| 294
| 10
|
159,068
|
private void _cleanChildren ( ) { //bStatsTreeNeedsUpdate = true; if ( children != null ) { Iterator values = children . values ( ) . iterator ( ) ; while ( values . hasNext ( ) ) { ModuleItem remMI = ( ModuleItem ) values . next ( ) ; remMI . getInstance ( ) . cleanup ( ) ; //_cleanMBean(remMI); remMI . _cleanChildren ( ) ; remMI = null ; } children . clear ( ) ; } }
|
recursively remove reference to child ModuleItem from children ArrayList
| 109
| 13
|
159,069
|
protected void configureCustomizeBinding ( Client client , QName portName ) { //put all properties defined in ibm-ws-bnd.xml into the client request context Map < String , Object > requestContext = client . getRequestContext ( ) ; if ( null != requestContext && null != wsrInfo ) { PortComponentRefInfo portRefInfo = wsrInfo . getPortComponentRefInfo ( portName ) ; Map < String , String > wsrProps = wsrInfo . getProperties ( ) ; Map < String , String > portProps = ( null != portRefInfo ) ? portRefInfo . getProperties ( ) : null ; if ( null != wsrProps ) { requestContext . putAll ( wsrProps ) ; } if ( null != portProps ) { requestContext . putAll ( portProps ) ; } if ( null != wsrProps && Boolean . valueOf ( wsrProps . get ( JaxWsConstants . ENABLE_lOGGINGINOUTINTERCEPTOR ) ) ) { List < Interceptor < ? extends Message > > inInterceptors = client . getInInterceptors ( ) ; inInterceptors . add ( new LoggingInInterceptor ( ) ) ; List < Interceptor < ? extends Message > > outInterceptors = client . getOutInterceptors ( ) ; outInterceptors . add ( new LoggingOutInterceptor ( ) ) ; } } Set < ConfigProperties > configPropsSet = servicePropertiesMap . get ( portName ) ; client . getOutInterceptors ( ) . add ( new LibertyCustomizeBindingOutInterceptor ( wsrInfo , securityConfigService , configPropsSet ) ) ; //need to add an interceptor to clean up HTTPTransportActivator.sorted & props via calling HTTPTransportActivator. deleted(String) //Memory Leak fix for 130985 client . getOutInterceptors ( ) . add ( new LibertyCustomizeBindingOutEndingInterceptor ( wsrInfo ) ) ; }
|
Add the LibertyCustomizeBindingOutInterceptor in the out interceptor chain .
| 445
| 17
|
159,070
|
private WebServiceFeature [ ] getWebServiceFeaturesOnPortComponentRef ( Class serviceEndpointInterface ) { WebServiceFeature [ ] returnArray = { } ; if ( serviceEndpointInterface != null && wsrInfo != null ) { String seiName = serviceEndpointInterface . getName ( ) ; PortComponentRefInfo pcr = wsrInfo . getPortComponentRefInfo ( seiName ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "SEI name = " + seiName ) ; Tr . debug ( tc , "PortComponentRefInfo found = " + pcr ) ; } if ( pcr != null ) { List < WebServiceFeatureInfo > featureInfoList = pcr . getWebServiceFeatureInfos ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "List of WebServiceFeatureInfo from PortComponentRefInfo = " + featureInfoList ) ; } if ( ! featureInfoList . isEmpty ( ) ) { returnArray = new WebServiceFeature [ featureInfoList . size ( ) ] ; for ( int i = 0 ; i < featureInfoList . size ( ) ; i ++ ) { WebServiceFeatureInfo featureInfo = featureInfoList . get ( i ) ; WebServiceFeature wsf = featureInfo . getWebServiceFeature ( ) ; returnArray [ i ] = wsf ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Added WebServiceFeature " + wsf ) ; } } } } } return returnArray ; }
|
Gets an array of features possibly enabled on client s port - component - ref in the deployment descriptor
| 334
| 20
|
159,071
|
private void configureClientProperties ( ) throws IOException { Map < String , String > serviceRefProps = wsrInfo . getProperties ( ) ; Iterator < QName > iterator = this . getPorts ( ) ; //wsrInfo.getBindingPortComponentRefInfoList(); while ( null != iterator && iterator . hasNext ( ) ) { QName portQName = iterator . next ( ) ; PortComponentRefInfo portInfo = wsrInfo . getPortComponentRefInfo ( portQName ) ; Map < String , String > portProps = ( null != portInfo ) ? portInfo . getProperties ( ) : null ; if ( ( null != serviceRefProps || null != portProps ) ) { prepareProperties ( portQName , serviceRefProps , portProps ) ; } } }
|
configure the http conduit properties defined in the custom binding file .
| 178
| 13
|
159,072
|
private void prepareProperties ( QName portQName , Map < String , String > serviceRefProps , Map < String , String > portProps ) throws IOException { // Merge the properties form port and service. Map < String , String > allProperties = new HashMap < String , String > ( ) ; if ( null != serviceRefProps ) { allProperties . putAll ( serviceRefProps ) ; } if ( null != portProps ) { allProperties . putAll ( portProps ) ; } for ( Map . Entry < String , String > entry : servicePidToPropertyPrefixMap . entrySet ( ) ) { String serviceFactoryPid = entry . getKey ( ) ; String prefix = entry . getValue ( ) ; // Extract the properties according to different property prefix, // update the extracted properties by corresponding factory service. Map < String , String > extractProps = extract ( prefix , allProperties ) ; // Put the port QName and the properties into the servicePropertiesMap ConfigProperties configProps = new ConfigProperties ( serviceFactoryPid , extractProps ) ; Set < ConfigProperties > configSet = servicePropertiesMap . get ( portQName ) ; if ( null == configSet ) { configSet = new HashSet < ConfigProperties > ( ) ; servicePropertiesMap . put ( portQName , configSet ) ; } if ( configSet . contains ( configProps ) ) { // re-add the config props configSet . remove ( configProps ) ; configSet . add ( configProps ) ; } else { configSet . add ( configProps ) ; } } }
|
merge the serviceRef properties and port properties and update the merged properties in the configAdmin service .
| 354
| 20
|
159,073
|
protected Map < String , String > extract ( String propertyPrefix , Map < String , String > properties , boolean removeProps ) { if ( null == properties || properties . isEmpty ( ) ) { return Collections . < String , String > emptyMap ( ) ; } Map < String , String > extractProps = new HashMap < String , String > ( ) ; Iterator < Map . Entry < String , String > > propIter = properties . entrySet ( ) . iterator ( ) ; while ( propIter . hasNext ( ) ) { Map . Entry < String , String > propEntry = propIter . next ( ) ; if ( null != propEntry . getKey ( ) && propEntry . getKey ( ) . startsWith ( propertyPrefix ) ) { String propKey = propEntry . getKey ( ) . substring ( propertyPrefix . length ( ) ) ; extractProps . put ( propKey , propEntry . getValue ( ) ) ; if ( removeProps ) { propIter . remove ( ) ; } } } return extractProps ; }
|
Extract the properties according to the property prefix .
| 226
| 10
|
159,074
|
protected Map < String , String > extract ( String propertyPrefix , Map < String , String > properties ) { return extract ( propertyPrefix , properties , true ) ; }
|
Extract the properties according to the property prefix will remove the extracted properties from original properties .
| 36
| 18
|
159,075
|
private boolean isKnownArgument ( String arg ) { final String argName = getArgName ( arg ) ; for ( String key : knownArgs ) { if ( key . equalsIgnoreCase ( argName ) ) { return true ; } } return false ; }
|
Checks if the argument is a known argument to the task .
| 55
| 13
|
159,076
|
protected String getTaskHelp ( String desc , String usage , String optionKeyPrefix , String optionDescPrefix , String addonKey , String footer , Object ... args ) { StringBuilder scriptHelp = new StringBuilder ( ) ; scriptHelp . append ( NL ) ; scriptHelp . append ( getOption ( "global.description" ) ) ; scriptHelp . append ( NL ) ; scriptHelp . append ( getOption ( desc ) ) ; scriptHelp . append ( NL ) ; // print a empty line scriptHelp . append ( NL ) ; scriptHelp . append ( getOption ( "global.usage" ) ) ; scriptHelp . append ( NL ) ; scriptHelp . append ( getOption ( usage ) ) ; scriptHelp . append ( NL ) ; String options = buildScriptOptions ( optionKeyPrefix , optionDescPrefix ) ; if ( ! options . isEmpty ( ) ) { // print a empty line scriptHelp . append ( NL ) ; scriptHelp . append ( getOption ( "global.options" ) ) ; scriptHelp . append ( options ) ; } if ( addonKey != null && ! addonKey . isEmpty ( ) ) { // print a empty line scriptHelp . append ( NL ) ; scriptHelp . append ( getOption ( addonKey ) ) ; } if ( footer != null && ! footer . isEmpty ( ) ) { scriptHelp . append ( footer ) ; } scriptHelp . append ( NL ) ; if ( args . length == 0 ) { return scriptHelp . toString ( ) ; } else { return MessageFormat . format ( scriptHelp . toString ( ) , args ) ; } }
|
Generate the formatted task help .
| 343
| 7
|
159,077
|
public String getDestination ( ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getDestination" ) ; SibTr . exit ( tc , "getDestination" , destination ) ; } return destination ; }
|
Returns the destination .
| 56
| 4
|
159,078
|
public String getSelector ( ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getSelector" ) ; SibTr . exit ( tc , "getSelector" , selector ) ; } return selector ; }
|
Returns the selector .
| 56
| 4
|
159,079
|
public int getSelectorDomain ( ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getSelectorDomain" ) ; SibTr . exit ( tc , "getSelectorDomain" , new Integer ( selectorDomain ) ) ; } return selectorDomain ; }
|
Returns the messaging domain in which the selector was sspecified .
| 65
| 12
|
159,080
|
public String getUser ( ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getUser" ) ; SibTr . exit ( tc , "getUser" , user ) ; } return user ; }
|
Returns the user .
| 53
| 4
|
159,081
|
public void setDestination ( String destination ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setDestination" , destination ) ; this . destination = destination ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setDestination" ) ; }
|
Sets the destination .
| 69
| 5
|
159,082
|
public void setSelector ( String selector ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setSelector" , selector ) ; this . selector = selector ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setSelector" ) ; }
|
Sets the selector .
| 69
| 5
|
159,083
|
public void setTopic ( String topic ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setTopic" , topic ) ; this . topic = topic ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setTopic" ) ; }
|
Sets the topic .
| 66
| 5
|
159,084
|
public boolean isNoLocal ( ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isNoLocal" ) ; SibTr . exit ( tc , "isNoLocal" , new Boolean ( noLocal ) ) ; } return noLocal ; }
|
Returns the noLocal .
| 62
| 5
|
159,085
|
public void setNoLocal ( boolean noLocal ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setNoLocal" , new Boolean ( noLocal ) ) ; this . noLocal = noLocal ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setNoLocal" ) ; }
|
Sets the noLocal .
| 77
| 6
|
159,086
|
@ FFDCIgnore ( URISyntaxException . class ) public static String namespaceURIToPackage ( String namespaceURI ) { try { return nameSpaceURIToPackage ( new URI ( namespaceURI ) ) ; } catch ( URISyntaxException ex ) { return null ; } }
|
Generates a Java package name from a URI according to the algorithm outlined in JAXB 2 . 0 .
| 62
| 22
|
159,087
|
public static String nameToIdentifier ( String name , IdentifierType type ) { if ( null == name || name . length ( ) == 0 ) { return name ; } // algorithm will not change an XML name that is already a legal and // conventional (!) Java class, method, or constant identifier boolean legalIdentifier = false ; StringBuilder buf = new StringBuilder ( name ) ; boolean hasUnderscore = false ; legalIdentifier = Character . isJavaIdentifierStart ( buf . charAt ( 0 ) ) ; for ( int i = 1 ; i < name . length ( ) && legalIdentifier ; i ++ ) { legalIdentifier &= Character . isJavaIdentifierPart ( buf . charAt ( i ) ) ; hasUnderscore |= ' ' == buf . charAt ( i ) ; } boolean conventionalIdentifier = isConventionalIdentifier ( buf , type ) ; if ( legalIdentifier && conventionalIdentifier ) { if ( JAXBUtils . isJavaKeyword ( name ) && type == IdentifierType . VARIABLE ) { name = normalizePackageNamePart ( name ) ; } if ( ! hasUnderscore || IdentifierType . CLASS != type ) { return name ; } } // split into words List < String > words = new ArrayList <> ( ) ; StringTokenizer st = new StringTokenizer ( name , XML_NAME_PUNCTUATION_STRING ) ; while ( st . hasMoreTokens ( ) ) { words . add ( st . nextToken ( ) ) ; } for ( int i = 0 ; i < words . size ( ) ; i ++ ) { splitWord ( words , i ) ; } return makeConventionalIdentifier ( words , type ) ; }
|
Converts an XML name to a Java identifier according to the mapping algorithm outlined in the JAXB specification
| 370
| 21
|
159,088
|
public static String getDefaultSSLSocketFactory ( ) { if ( defaultSSLSocketFactory == null ) { defaultSSLSocketFactory = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override public String run ( ) { return Security . getProperty ( "ssl.SocketFactory.provider" ) ; } } ) ; } return defaultSSLSocketFactory ; }
|
Get the default SSLSocketFactory from Security .
| 85
| 10
|
159,089
|
public static String getDefaultSSLServerSocketFactory ( ) { if ( defaultSSLServerSocketFactory == null ) { defaultSSLServerSocketFactory = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override public String run ( ) { return Security . getProperty ( "ssl.ServerSocketFactory.provider" ) ; } } ) ; } return defaultSSLServerSocketFactory ; }
|
Get the default SSLServerSocketFactory class from Security .
| 90
| 12
|
159,090
|
public static String getKeyManagerFactoryAlgorithm ( ) { if ( keyManagerFactoryAlgorithm == null ) { keyManagerFactoryAlgorithm = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override public String run ( ) { return Security . getProperty ( "ssl.KeyManagerFactory.algorithm" ) ; } } ) ; } return keyManagerFactoryAlgorithm ; }
|
Get the key manager factory algorithm default from Security .
| 86
| 10
|
159,091
|
public static String getTrustManagerFactoryAlgorithm ( ) { if ( trustManagerFactoryAlgorithm == null ) { trustManagerFactoryAlgorithm = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override public String run ( ) { return Security . getProperty ( "ssl.TrustManagerFactory.algorithm" ) ; } } ) ; } return trustManagerFactoryAlgorithm ; }
|
Get the trust manager factory algorithm default from Security .
| 86
| 10
|
159,092
|
public static void initializeIBMCMSProvider ( ) throws Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "initializeIBMCMSProvider" ) ; Provider provider = Security . getProvider ( Constants . IBMCMS_NAME ) ; if ( provider != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "initializeIBMCMSProvider (already present)" ) ; return ; } AccessController . doPrivileged ( new PrivilegedAction < Object > ( ) { @ Override public Object run ( ) { try { Provider cmsprovider = ( Provider ) Class . forName ( Constants . IBMCMS ) . newInstance ( ) ; if ( cmsprovider != null ) { Security . addProvider ( cmsprovider ) ; } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception loading provider: " + Constants . IBMCMS ) ; } return null ; } } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "initializeIBMCMSProvider (provider initialized)" ) ; }
|
Initialize the IBM CMS provider .
| 295
| 7
|
159,093
|
public static void insertProviderAt ( Provider newProvider , int slot ) { Provider [ ] provider_list = Security . getProviders ( ) ; if ( null == provider_list || 0 == provider_list . length ) { return ; } // add the new provider to the new list at the correct slot #. Provider [ ] newList = new Provider [ provider_list . length + 2 ] ; newList [ slot ] = newProvider ; int newListIndex = 1 ; // add the rest of the providers for ( int i = 0 ; i < provider_list . length ; i ++ ) { Provider currentProvider = provider_list [ i ] ; if ( currentProvider != null && ! currentProvider . getName ( ) . equals ( newProvider . getName ( ) ) ) { // keep incrementing until we find the first available slot. while ( newList [ newListIndex ] != null ) { newListIndex ++ ; } newList [ newListIndex ] = currentProvider ; newListIndex ++ ; } } removeAllProviders ( ) ; // add the rest of the providers to the list. for ( int i = 0 ; i < newList . length ; i ++ ) { Provider currentProvider = newList [ i ] ; if ( currentProvider != null ) { int position = Security . insertProviderAt ( currentProvider , ( i + 1 ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , currentProvider . getName ( ) + " provider added at position " + position ) ; } } }
|
Insert a provider into Security at the provided slot number .
| 334
| 11
|
159,094
|
public static void removeAllProviders ( ) { Provider [ ] provider_list = Security . getProviders ( ) ; for ( int i = 0 ; i < provider_list . length ; i ++ ) { if ( provider_list [ i ] != null ) { String name = provider_list [ i ] . getName ( ) ; if ( name != null ) { Security . removeProvider ( name ) ; } } } }
|
Remove all providers from Security .
| 90
| 6
|
159,095
|
static void validateAsyncOnInterfaces ( Class < ? > [ ] ifaces , TraceComponent tc ) { if ( ifaces != null ) { for ( Class < ? > iface : ifaces ) { // d645943 - Modified the fix integrated for d618337 to include both // the class-level and method-level checks. Since no-interface view // beans are the interface, we need to check that the business // "interface" is really a Java interface. if ( iface . isInterface ( ) ) { if ( iface . getAnnotation ( Asynchronous . class ) != null ) { //interface contains class-level @Asynchronous annotation Tr . warning ( tc , "ASYNC_ON_INTERFACE_CNTR0305W" , iface . getName ( ) ) ; continue ; } for ( Method m : iface . getMethods ( ) ) { if ( m . getAnnotation ( Asynchronous . class ) != null ) { //interface method contains @Asynchronous annotation Tr . warning ( tc , "ASYNC_ON_INTERFACE_CNTR0305W" , iface . getName ( ) ) ; break ; // break out of the method for-loop - continue on to the next interface } } } } } }
|
F743 - 13921
| 266
| 6
|
159,096
|
@ Modified protected void modified ( ComponentContext context ) throws Exception { processProperties ( context . getProperties ( ) ) ; deregisterJavaMailMBean ( ) ; registerJavaMailMBean ( ) ; }
|
The Modified method is how the properties that are defined in the mailSession object of the server . xml are extracted and stored in the sessionProperties .
| 46
| 30
|
159,097
|
@ Override public Object createResource ( ResourceInfo info ) throws Exception { Properties propertyNames = createPropertyNames ( ) ; Properties props = createProperties ( propertyNames ) ; // The listOfPropMap is how the nested properties (name, value pairs) are // pulled from the Nester class. This iterates the map and stores them in the // props object if ( listOfPropMap != null ) { for ( Map < String , Object > nestedProperties : listOfPropMap ) { props . put ( nestedProperties . get ( NAME ) , nestedProperties . get ( VALUE ) ) ; } } Session session = createSession ( props ) ; return session ; }
|
The createResource uses the sessionProperties to create a javax . mail . Session object and return it to the caller . The caller uses JNDI look up with the JNDI name defined in the server . xml .
| 142
| 47
|
159,098
|
private Properties createProperties ( Properties propertyNames ) { Properties props = new Properties ( ) ; for ( String key : propertiesArray ) { if ( sessionProperties . get ( key ) != null ) { if ( ! key . equalsIgnoreCase ( STOREPROTOCOLCLASSNAME ) && ! key . equalsIgnoreCase ( TRANSPORTPROTOCOLCLASSNAME ) ) { props . put ( key , sessionProperties . get ( key ) ) ; if ( propertyNames . getProperty ( key ) != null ) props . put ( propertyNames . getProperty ( key ) , sessionProperties . get ( key ) ) ; } else { if ( key . equalsIgnoreCase ( STOREPROTOCOLCLASSNAME ) ) props . put ( "mail." + props . getProperty ( STOREPROTOCOL ) + ".class" , sessionProperties . get ( key ) ) ; else props . put ( "mail." + props . getProperty ( TRANSPORTPROTOCOL ) + ".class" , sessionProperties . get ( key ) ) ; } } } return props ; }
|
The createProperties method will iterate through the sessionProperties and put them into the props object so that it can be used to create the javax . mail . Session
| 235
| 36
|
159,099
|
private Properties createPropertyNames ( ) { Properties propertyNames = new Properties ( ) ; propertyNames . setProperty ( HOST , "mail.host" ) ; propertyNames . setProperty ( USER , "mail.user" ) ; propertyNames . setProperty ( FROM , "mail.from" ) ; propertyNames . setProperty ( TRANSPORTPROTOCOL , "mail.transport.protocol" ) ; propertyNames . setProperty ( STOREPROTOCOL , "mail.store.protocol" ) ; return propertyNames ; }
|
The createPropertyName method sets a property for five special strings that can be set in a different method such as mail . host . These are different way to set certain property values and are unique to these five
| 117
| 41
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.