idx
int64 0
41.2k
| question
stringlengths 83
4.15k
| target
stringlengths 5
715
|
|---|---|---|
35,600
|
public final void start ( ) throws XAException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "start" , new Object [ ] { _resource , printState ( _state ) } ) ; if ( tcSummary . isDebugEnabled ( ) ) Tr . debug ( tcSummary , "xa_start" , this ) ; int rc = - 1 ; try { int flags ; switch ( _state ) { case NOT_ASSOCIATED : flags = _startFlag ; break ; case NOT_ASSOCIATED_AND_TMJOIN : flags = XAResource . TMJOIN ; break ; case ACTIVE : if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "startAssociation" ) ; return ; case SUSPENDED : if ( ! _supportResume ) { Tr . warning ( tc , "WTRN0021_TMRESUME_NOT_SUPPORTED" ) ; throw new XAException ( XAException . XAER_INVAL ) ; } flags = XAResource . TMRESUME ; break ; case ROLLBACK_ONLY : throw new XAException ( XAException . XA_RBROLLBACK ) ; default : Tr . warning ( tc , "WTRN0022_UNKNOWN_XARESOURCE_STATE" ) ; case FAILED : case IDLE : throw new XAException ( XAException . XAER_PROTO ) ; } if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "xa_start with flag: " + Util . printFlag ( flags ) ) ; _resource . start ( _xid , flags ) ; rc = XAResource . XA_OK ; _state = ACTIVE ; } catch ( XAException xae ) { processXAException ( "start" , xae ) ; rc = xae . errorCode ; if ( xae . errorCode >= XAException . XA_RBBASE && xae . errorCode <= XAException . XA_RBEND ) _state = ROLLBACK_ONLY ; else if ( xae . errorCode != XAException . XAER_OUTSIDE ) _state = FAILED ; throw xae ; } catch ( Throwable t ) { _state = FAILED ; processThrowable ( "start" , t ) ; } finally { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "start" ) ; if ( tcSummary . isDebugEnabled ( ) ) Tr . debug ( tcSummary , "xa_start result:" , XAReturnCodeHelper . convertXACode ( rc ) ) ; } }
|
Associate the underlying XAResource with a transaction .
|
35,601
|
public final void end ( int flag ) throws XAException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "end" , new Object [ ] { _resource , Util . printFlag ( flag ) , printState ( _state ) } ) ; if ( tcSummary . isDebugEnabled ( ) ) Tr . debug ( tcSummary , "xa_end" , new Object [ ] { this , "flags = " + Util . printFlag ( flag ) } ) ; int newstate ; int rc = - 1 ; switch ( flag ) { case XAResource . TMSUCCESS : if ( _state == ACTIVE || _state == SUSPENDED ) { newstate = IDLE ; } else { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "end" ) ; return ; } break ; case XAResource . TMFAIL : if ( _state == ROLLBACK_ONLY || _state == IDLE || _state == FAILED ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "end" ) ; return ; } newstate = ROLLBACK_ONLY ; break ; case XAResource . TMSUSPEND : if ( ! _supportSuspend ) { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "TMSUSPEND is not supported." ) ; throw new XAException ( XAException . XAER_INVAL ) ; } else if ( _state == FAILED || _state == IDLE ) { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "TMSUSPEND in invalid state." ) ; throw new XAException ( XAException . XAER_PROTO ) ; } else if ( _state != ACTIVE ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "end" ) ; return ; } newstate = SUSPENDED ; break ; default : Tr . warning ( tc , "WTRN0023_INVALID_XAEND_FLAG" , Util . printFlag ( flag ) ) ; throw new XAException ( XAException . XAER_INVAL ) ; } try { _resource . end ( _xid , flag ) ; rc = XAResource . XA_OK ; _state = newstate ; } catch ( XAException xae ) { processXAException ( "end" , xae ) ; rc = xae . errorCode ; if ( xae . errorCode >= XAException . XA_RBBASE && xae . errorCode <= XAException . XA_RBEND ) _state = ROLLBACK_ONLY ; else _state = FAILED ; throw xae ; } catch ( Throwable t ) { _state = FAILED ; processThrowable ( "end" , t ) ; } finally { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "end" ) ; if ( tcSummary . isDebugEnabled ( ) ) Tr . debug ( tcSummary , "xa_end result:" , XAReturnCodeHelper . convertXACode ( rc ) ) ; } }
|
Terminate the association of the XAResource with this transaction .
|
35,602
|
protected void activate ( ComponentContext context , Map < String , Object > properties ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , CLASS_NAME + "activate" , new Object [ ] { context , properties } ) ; } try { service = new JsMainAdminServiceImpl ( ) ; configAdminRef . activate ( context ) ; messageStoreRef . activate ( context ) ; destinationAddressFactoryRef . activate ( context ) ; jsAdminServiceref . activate ( context ) ; service . activate ( context , properties , configAdminRef . getService ( ) ) ; } catch ( Exception e ) { SibTr . exception ( tc , e ) ; FFDCFilter . processException ( e , this . getClass ( ) . getName ( ) , "133" , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , CLASS_NAME + "activate" ) ; } }
|
This method is call by the declarative service when the feature is activated
|
35,603
|
protected void modified ( ComponentContext context , Map < String , Object > properties ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , CLASS_NAME + "modified" , new Object [ ] { context , properties } ) ; } try { if ( service . getMeState ( ) . equals ( ME_STATE . STOPPED . toString ( ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . debug ( tc , "Starting ME" , service . getMeState ( ) ) ; SibTr . info ( tc , "RESTART_ME_SIAS0106" ) ; service . activate ( context , properties , configAdminRef . getService ( ) ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . debug ( tc , "Modifying the configuration" , service . getMeState ( ) ) ; service . modified ( context , properties , configAdminRef . getService ( ) ) ; } } catch ( Exception e ) { SibTr . exception ( tc , e ) ; FFDCFilter . processException ( e , this . getClass ( ) . getName ( ) , "187" , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , CLASS_NAME + "modified" ) ; } }
|
This method is call by the declarative service when there is configuration change
|
35,604
|
@ Reference ( name = KEY_MESSAGE_STORE , service = MessageStore . class ) protected void setMessageStore ( ServiceReference < MessageStore > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . entry ( tc , "setMessageStore" , ref ) ; messageStoreRef . setReference ( ref ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . exit ( tc , "setMessageStore" ) ; }
|
Declarative Services method for setting the MessageStore service reference .
|
35,605
|
protected void unsetMessageStore ( ServiceReference < MessageStore > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . entry ( tc , "unsetMessageStore" , ref ) ; messageStoreRef . unsetReference ( ref ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . exit ( tc , "unsetMessageStore" ) ; }
|
Declarative Services method for unsetting the MessageStore service reference .
|
35,606
|
@ Reference ( name = KEY_DESTINATION_ADDRESS_FACTORY , service = SIDestinationAddressFactory . class ) protected void setDestinationAddressFactory ( ServiceReference < SIDestinationAddressFactory > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . entry ( tc , "setDestinationAddressFactory" , ref ) ; destinationAddressFactoryRef . setReference ( ref ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . exit ( tc , "setDestinationAddressFactory" ) ; }
|
Declarative Services method for setting the DestinationAddressFactory service reference .
|
35,607
|
protected void unsetDestinationAddressFactory ( ServiceReference < SIDestinationAddressFactory > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . entry ( tc , "unsetDestinationAddressFactory" , ref ) ; destinationAddressFactoryRef . setReference ( ref ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . exit ( tc , "unsetDestinationAddressFactory" ) ; }
|
Declarative Services method for unsetting the DestinationAddressFactory service reference .
|
35,608
|
@ Reference ( name = KEY_JS_ADMIN_SERVICE , service = JsAdminService . class ) protected void setJsAdminService ( ServiceReference < JsAdminService > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . entry ( tc , "setJsAdminService" , ref ) ; jsAdminServiceref . setReference ( ref ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . exit ( tc , "setJsAdminService" ) ; }
|
Declarative Services method for setting the JsAdminService service reference .
|
35,609
|
protected void unsetJsAdminService ( ServiceReference < JsAdminService > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . entry ( tc , "unsetJsAdminService" , ref ) ; jsAdminServiceref . setReference ( ref ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . exit ( tc , "unsetJsAdminService" ) ; }
|
Declarative Services method for unsetting the JsAdminService service reference .
|
35,610
|
public static void initialiseAcceptListenerFactory ( AcceptListenerFactory _acceptListenerFactory ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "initialiseAcceptListenerFactory" , _acceptListenerFactory ) ; Class clientImpl = instance . getClass ( ) ; Method initialiseAcceptListenerFactoryMethod ; try { initialiseAcceptListenerFactoryMethod = clientImpl . getMethod ( "initialiseAcceptListenerFactory" , new Class [ ] { AcceptListenerFactory . class } ) ; initialiseAcceptListenerFactoryMethod . invoke ( clientImpl , new Object [ ] { _acceptListenerFactory } ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.jfapchannel.ServerConnectionManager.initialiseAcceptListenerFactory" , JFapChannelConstants . SRVRCONNMGR_INITIALISE_ALF_01 ) ; Throwable displayedException = e ; if ( e instanceof InvocationTargetException ) displayedException = e . getCause ( ) ; SibTr . error ( tc , "EXCP_DURING_INIT_SICJ0081" , new Object [ ] { clientImpl , displayedException } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( tc , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "initialiseAcceptListenerFactory" ) ; }
|
Sets an AcceptListenerFactory on the full implementation of the ServerConnectionManager implementation .
|
35,611
|
private void setCredential ( Subject subject , WSPrincipal principal ) throws CredentialException { String securityName = principal . getName ( ) ; Hashtable < String , ? > customProperties = getUniqueIdHashtableFromSubject ( subject ) ; if ( customProperties == null || customProperties . isEmpty ( ) ) { UserRegistryService urService = userRegistryServiceRef . getService ( ) ; if ( urService != null ) { String urType = urService . getUserRegistryType ( ) ; if ( "WIM" . equalsIgnoreCase ( urType ) || "LDAP" . equalsIgnoreCase ( urType ) ) { try { securityName = urService . getUserRegistry ( ) . getUserDisplayName ( securityName ) ; } catch ( Exception e ) { } } } } if ( securityName == null || securityName . length ( ) == 0 ) { securityName = principal . getName ( ) ; } String accessId = principal . getAccessId ( ) ; String customRealm = null ; String realm = null ; String uniqueName = null ; if ( customProperties != null ) { customRealm = ( String ) customProperties . get ( AttributeNameConstants . WSCREDENTIAL_REALM ) ; } if ( customRealm != null ) { realm = customRealm ; String [ ] parts = accessId . split ( realm + "/" ) ; if ( parts != null && parts . length == 2 ) uniqueName = parts [ 1 ] ; } else { realm = AccessIdUtil . getRealm ( accessId ) ; uniqueName = AccessIdUtil . getUniqueId ( accessId ) ; } if ( AccessIdUtil . isServerAccessId ( accessId ) ) { setCredential ( null , subject , realm , securityName , uniqueName , null , accessId , null , null ) ; } else { CredentialsService cs = credentialsServiceRef . getService ( ) ; String unauthenticatedUserid = cs . getUnauthenticatedUserid ( ) ; if ( securityName != null && unauthenticatedUserid != null && securityName . equals ( unauthenticatedUserid ) ) { setCredential ( unauthenticatedUserid , subject , realm , securityName , uniqueName , null , null , null , null ) ; } else if ( AccessIdUtil . isUserAccessId ( accessId ) ) { createUserWSCredential ( subject , securityName , accessId , realm , uniqueName , unauthenticatedUserid ) ; } } }
|
Create a WSCredential for the specified accessId . If this accessId came from the current UserRegistry create a WsCredential . If not then do nothing .
|
35,612
|
private List < String > getUniqueGroupAccessIds ( UserRegistry userRegistry , String realm , String uniqueName ) throws EntryNotFoundException , RegistryException { List < String > uniqueGroupAccessIds = new ArrayList < String > ( ) ; List < String > uniqueGroupIds = userRegistry . getUniqueGroupIdsForUser ( uniqueName ) ; Iterator < String > groupIter = uniqueGroupIds . iterator ( ) ; while ( groupIter . hasNext ( ) ) { String groupAccessId = AccessIdUtil . createAccessId ( AccessIdUtil . TYPE_GROUP , realm , groupIter . next ( ) ) ; uniqueGroupAccessIds . add ( groupAccessId ) ; } return uniqueGroupAccessIds ; }
|
Get a list of all of the groups the user belongs to formated as group access IDs .
|
35,613
|
private String getPrimaryGroupId ( List < String > uniqueGroupIds ) { return uniqueGroupIds . isEmpty ( ) ? null : uniqueGroupIds . get ( 0 ) ; }
|
Get the primary group ID . This is assumed to be the first group in the group list .
|
35,614
|
@ FFDCIgnore ( { CredentialDestroyedException . class , CredentialExpiredException . class } ) public boolean isSubjectValid ( Subject subject ) { boolean valid = false ; try { WSCredential wsCredential = getWSCredential ( subject ) ; if ( wsCredential != null ) { long credentialExpirationInMillis = wsCredential . getExpiration ( ) ; Date currentTime = new Date ( ) ; Date expirationTime = new Date ( credentialExpirationInMillis ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Current time = " + currentTime + ", expiration time = " + expirationTime ) ; } if ( credentialExpirationInMillis == 0 || credentialExpirationInMillis == - 1 || currentTime . before ( expirationTime ) ) { valid = true ; } } } catch ( CredentialDestroyedException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "CredentialDestroyedException while determining the validity of the subject." , e ) ; } } catch ( CredentialExpiredException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "CredentialExpiredException while determining the validity of the subject." , e ) ; } } return valid ; }
|
Checks if the subject is valid . Currently a subject is REQUIRED to have a WSCredential and it is only valid if the WSCredential is not expired .
|
35,615
|
private SibRaConnection createConnection ( ConnectionRequestInfo requestInfo ) throws SIResourceException , SINotPossibleInCurrentConfigurationException , SIIncorrectCallException , SIAuthenticationException { if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "createConnection" , requestInfo ) ; } SibRaConnection result = null ; boolean tryAgain = true ; do { try { final Object connection = _connectionManager . allocateConnection ( _managedConnectionFactory , requestInfo ) ; if ( connection instanceof SibRaConnection ) { result = ( SibRaConnection ) connection ; SibRaManagedConnection managedConnection = result . getManagedConnection ( ) ; result . setConnectionFactory ( this ) ; tryAgain = result . isCoreConnectionInValid ( ) ; if ( tryAgain ) { SibTr . info ( TRACE , NLS . getString ( "CONNECTION_ERROR_RETRY_CWSIV0356" ) , new Object [ ] { result . getManagedConnection ( ) . getConnectionException ( ) } ) ; requestInfo = ( ConnectionRequestInfo ) ( ( SibRaConnectionRequestInfo ) requestInfo ) . clone ( ) ; ( ( SibRaConnectionRequestInfo ) requestInfo ) . incrementRequestCounter ( ) ; managedConnection . connectionErrorOccurred ( new SIResourceException ( ) , true ) ; } } else { final ResourceException exception = new ResourceAdapterInternalException ( NLS . getFormattedMessage ( "INCORRECT_CONNECTION_TYPE_CWSIV0101" , new Object [ ] { connection , SibRaConnection . class } , null ) ) ; if ( TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } throw exception ; } } catch ( ResourceException exception ) { FFDCFilter . processException ( exception , "com.ibm.ws.sib.ra.impl.SibRaConnectionFactory.createConnection" , "1:318:1.21" , this ) ; if ( TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } if ( exception . getCause ( ) instanceof SIResourceException ) { throw ( SIResourceException ) exception . getCause ( ) ; } else if ( exception . getCause ( ) instanceof SIErrorException ) { throw ( SIErrorException ) exception . getCause ( ) ; } else if ( exception . getCause ( ) instanceof SINotPossibleInCurrentConfigurationException ) { throw ( SINotPossibleInCurrentConfigurationException ) exception . getCause ( ) ; } else if ( exception . getCause ( ) instanceof SIIncorrectCallException ) { throw ( SIIncorrectCallException ) exception . getCause ( ) ; } else if ( exception . getCause ( ) instanceof SIAuthenticationException ) { throw ( SIAuthenticationException ) exception . getCause ( ) ; } else { throw new SIResourceException ( NLS . getString ( "CONNECTION_FACTORY_EXCEPTION_CWSIV0050" ) , exception ) ; } } } while ( tryAgain ) ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "createConnection" , result ) ; } return result ; }
|
Creates a connection via the connection manager .
|
35,616
|
public void storeRecord ( RepositoryLogRecord record ) { if ( isClosed ) { throw new IllegalStateException ( "This instance of the exporter is already closed" ) ; } if ( ! isInitialized ) { throw new IllegalStateException ( "This instance of the exporter does not have header information yet" ) ; } String formatRecord = formatter . formatRecord ( record ) ; out . print ( formatRecord ) ; out . print ( formatter . getLineSeparator ( ) ) ; }
|
Stores a RepositoryLogRecord into the proper text format
|
35,617
|
protected boolean acceptAnnotationsFrom ( String className , boolean acceptPartial , boolean acceptExcluded ) { String methodName = "acceptAnnotationsFrom" ; if ( config . isMetadataComplete ( ) ) { if ( ! acceptPartial && ! acceptExcluded ) { return false ; } } try { WebAnnotations webAppAnnotations = getModuleContainer ( ) . adapt ( WebAnnotations . class ) ; AnnotationTargets_Targets table = webAppAnnotations . getAnnotationTargets ( ) ; return ( table . isSeedClassName ( className ) || ( acceptPartial && table . isPartialClassName ( className ) ) || ( acceptExcluded && table . isExcludedClassName ( className ) ) ) ; } catch ( UnableToAdaptException e ) { logger . logp ( Level . FINE , CLASS_NAME , methodName , "caught UnableToAdaptException: " + e ) ; return false ; } }
|
Tell if annotations on a target class are to be processed . This is controlled by the metadata - complete and absolute ordering settings of the web module .
|
35,618
|
protected void createSessionContext ( DeployedModule moduleConfig ) throws Throwable { try { ArrayList sessionRelatedListeners [ ] = new ArrayList [ ] { sessionListeners , sessionAttrListeners , sessionIdListeners } ; this . sessionCtx = ( ( WebGroup ) parent ) . getSessionContext ( moduleConfig , this , sessionRelatedListeners ) ; } catch ( Throwable th ) { logger . logp ( Level . SEVERE , CLASS_NAME , "createSessionContext" , "error.obtaining.session.context" , th ) ; throw new WebAppNotLoadedException ( th . getMessage ( ) ) ; } }
|
Method createSessionContext .
|
35,619
|
protected void initializeTargetMappings ( ) throws Exception { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . entering ( CLASS_NAME , "initializeTargetMappings" ) ; initializeStaticFileHandler ( ) ; initializeInvokerProcessor ( ) ; if ( config . isDirectoryBrowsingEnabled ( ) ) { try { IServletWrapper dirServlet = getServletWrapper ( "DirectoryBrowsingServlet" ) ; requestMapper . addMapping ( DIR_BROWSING_MAPPING , dirServlet ) ; } catch ( WebContainerException wce ) { logger . logp ( Level . WARNING , CLASS_NAME , "initializeTargetMappings" , "mapping.for.directorybrowsingservlet.already.exists" ) ; } catch ( Exception exc ) { logger . logp ( Level . WARNING , CLASS_NAME , "initializeTargetMappings" , "mapping.for.directorybrowsingservlet.already.exists" ) ; } } }
|
Method initializeTargetMappings .
|
35,620
|
private void initializeNonDDRepresentableAnnotation ( IServletConfig servletConfig ) { if ( com . ibm . ws . webcontainer . osgi . WebContainer . isServerStopping ( ) ) return ; String methodName = "initializeNonDDRepresentableAnnotation" ; String configClassName = servletConfig . getClassName ( ) ; if ( configClassName == null ) { return ; } if ( ! acceptAnnotationsFrom ( configClassName , DO_NOT_ACCEPT_PARTIAL , DO_NOT_ACCEPT_EXCLUDED ) ) { return ; } Class < ? > configClass ; try { configClass = Class . forName ( configClassName , false , this . getClassLoader ( ) ) ; } catch ( ClassNotFoundException e ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { LoggingUtil . logParamsAndException ( logger , Level . FINE , CLASS_NAME , methodName , "unable to load class [{0}] which is benign if the class is never used" , new Object [ ] { configClassName } , e ) ; } return ; } catch ( NoClassDefFoundError e ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { LoggingUtil . logParamsAndException ( logger , Level . FINE , CLASS_NAME , methodName , "unable to load class [{0}] which is benign if the class is never used" , new Object [ ] { configClassName } , e ) ; } return ; } checkForServletSecurityAnnotation ( configClass , servletConfig ) ; }
|
Process any annotation which could not be managed by an update to the the descriptor based configuration .
|
35,621
|
@ FFDCIgnore ( Exception . class ) protected void addStaticFilePatternMappings ( RequestProcessor proxyReqProcessor ) { String nextPattern ; ExtensionProcessor fileExtensionProcessor = getDefaultExtensionProcessor ( this , getConfiguration ( ) . getFileServingAttributes ( ) ) ; List patternList = fileExtensionProcessor . getPatternList ( ) ; Iterator patternIter = patternList . iterator ( ) ; int globalPatternsCount = 0 ; while ( patternIter . hasNext ( ) ) { nextPattern = ( String ) patternIter . next ( ) ; try { if ( proxyReqProcessor == null ) requestMapper . addMapping ( nextPattern , fileExtensionProcessor ) ; else requestMapper . addMapping ( nextPattern , proxyReqProcessor ) ; } catch ( Exception e ) { if ( ! ! ! "/*" . equals ( nextPattern ) ) { logger . logp ( Level . SEVERE , CLASS_NAME , "initializeStaticFileHandler" , "error.adding.servlet.mapping.file.handler" , nextPattern ) ; } else { globalPatternsCount ++ ; } } } if ( globalPatternsCount > 1 ) { logger . logp ( Level . SEVERE , CLASS_NAME , "initializeStaticFileHandler" , "error.adding.servlet.mapping.file.handler" , "/*" ) ; } }
|
defect 39851 needs to stop the exception from always being thrown
|
35,622
|
public IServletWrapper getServletWrapper ( String servletName , boolean addMapping ) throws Exception { IServletWrapper targetWrapper = null ; IServletConfig sconfig = config . getServletInfo ( servletName ) ; if ( sconfig != null ) { IServletWrapper existingServletWrapper = sconfig . getServletWrapper ( ) ; if ( existingServletWrapper != null ) return existingServletWrapper ; } List < String > mappings = config . getServletMappings ( servletName ) ; if ( mappings != null ) { for ( String mapping : mappings ) { if ( mapping . length ( ) > 0 && mapping . charAt ( 0 ) != '/' && mapping . charAt ( 0 ) != '*' ) mapping = '/' + mapping ; RequestProcessor p = requestMapper . map ( mapping ) ; if ( p != null ) { if ( p instanceof IServletWrapper ) { if ( ( ( IServletWrapper ) p ) . getServletName ( ) . equals ( servletName ) ) { targetWrapper = ( IServletWrapper ) p ; break ; } } } } } if ( targetWrapper != null ) return targetWrapper ; if ( sconfig == null ) { int internalIndex ; if ( ( internalIndex = getInternalServletIndex ( servletName ) ) >= 0 ) { sconfig = loadInternalConfig ( servletName , internalIndex ) ; } else { return null ; } } IServletWrapper sw = webExtensionProcessor . createServletWrapper ( sconfig ) ; return sw ; }
|
Method getServletWrapper .
|
35,623
|
private ServletConfig loadInternalConfig ( String servletName , int internalIndex ) throws ServletException { ServletConfig sconfig = createConfig ( "InternalServlet_" + servletName , internalIndex ) ; sconfig . setServletName ( servletName ) ; sconfig . setDisplayName ( servletName ) ; sconfig . setServletContext ( this . getFacade ( ) ) ; sconfig . setIsJsp ( false ) ; sconfig . setClassName ( internalServletList [ internalIndex ] [ 1 ] ) ; return sconfig ; }
|
Method loadInternalConfig .
|
35,624
|
protected Object loadListener ( String lClassName ) throws InjectionException , Throwable { Object listener = null ; try { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "loadListener" , "loadListener Classloader " + getClassLoader ( ) ) ; listener = java . beans . Beans . instantiate ( getClassLoader ( ) , lClassName ) ; } catch ( Throwable th ) { logError ( "Failed to load listener: " + lClassName , th ) ; if ( WCCustomProperties . STOP_APP_STARTUP_ON_LISTENER_EXCEPTION ) { throw th ; } } return listener ; }
|
LIDB1234 . 2 - added method below to load a listener class
|
35,625
|
public void addToStartWeightList ( IServletConfig sc ) { if ( this . sortedServletConfigs == null ) return ; int size = this . sortedServletConfigs . size ( ) ; int pos = 0 ; boolean added = false ; if ( size == 0 || ! sc . isLoadOnStartup ( ) ) sortedServletConfigs . add ( sc ) ; else { if ( sc . isAddedToLoadOnStartup ( ) && sc . isWeightChanged ( ) ) sortedServletConfigs . remove ( sc ) ; int value = sc . getStartUpWeight ( ) ; for ( IServletConfig curServletConfig : sortedServletConfigs ) { int curStartupWeight = curServletConfig . getStartUpWeight ( ) ; if ( value < curStartupWeight || ! curServletConfig . isLoadOnStartup ( ) ) { sortedServletConfigs . add ( pos , sc ) ; added = true ; break ; } pos ++ ; } if ( ! added ) sortedServletConfigs . add ( sc ) ; } sc . setAddedToLoadOnStartup ( true ) ; }
|
Method addToStartWeightList .
|
35,626
|
public void notifyStart ( ) { try { eventSource . onApplicationAvailableForService ( new ApplicationEvent ( this , this , new com . ibm . ws . webcontainer . util . IteratorEnumerator ( config . getServletNames ( ) ) ) ) ; } catch ( Exception e ) { com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( e , CLASS_NAME + ".started" , "3220" , this ) ; logger . logp ( Level . SEVERE , CLASS_NAME , "started" , "error.on.collaborator.started.call" ) ; } }
|
use the started method above for any started specific requirements
|
35,627
|
public void addMappingFilter ( IServletConfig sConfig , IFilterConfig config ) { IFilterMapping fmapping = new FilterMapping ( null , config , sConfig ) ; _addMapingFilter ( config , fmapping ) ; }
|
Adds a filter against a specified servlet config into this context
|
35,628
|
public void initialize ( ) throws ServletException , Throwable { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . entering ( CLASS_NAME , "Initialize : app = " + config . getApplicationName ( ) + ", initialized = " + initialized + ", destroyed = " + destroyed ) ; if ( ! initialized && ! destroyed ) { synchronized ( lock ) { if ( ! initialized && ! destroyed && ! com . ibm . ws . webcontainer . osgi . WebContainer . isServerStopping ( ) ) { initialize ( this . config , this . moduleConfig , this . extensionFactories ) ; started ( ) ; initialized = true ; config . setSessionCookieConfigInitilialized ( ) ; } } } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . exiting ( CLASS_NAME , "Initialize : initialized = " + initialized + ", destroyed = " + destroyed ) ; }
|
LIBERTY Added for delayed start .
|
35,629
|
public void setModuleContainer ( com . ibm . wsspi . adaptable . module . Container c ) { container = c ; metaInfResourceFinder = new MetaInfResourceFinder ( container ) ; }
|
LIBERTY add to set the Adaptable API Container
|
35,630
|
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 ( possibleContainer != null && ! possibleContainer . isRoot ( ) ) { path = path + "/" ; } s . add ( path ) ; } }
|
Add all entry paths from the Container into the Set
|
35,631
|
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 ) ; addEntry ( _bus . getName ( ) , dd , topicspace ) ; } } } } 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
|
35,632
|
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
|
35,633
|
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
|
35,634
|
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
|
35,635
|
protected void setSecurityService ( SecurityService securityService ) { SibTr . entry ( tc , CLASS_NAME + "setSecurityService" , securityService ) ; this . securityService = securityService ; SibTr . exit ( tc , CLASS_NAME + "setSecurityService" ) ; }
|
Binding Security Service
|
35,636
|
protected void unsetSecurityService ( SecurityService securityService ) { SibTr . entry ( tc , CLASS_NAME + "unsetSecurityService" , securityService ) ; SibTr . exit ( tc , CLASS_NAME + "unsetSecurityService" ) ; }
|
Unbinding Security Service
|
35,637
|
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
|
35,638
|
protected void unsetConfigAdmin ( ConfigurationAdmin configAdmin ) { SibTr . entry ( tc , CLASS_NAME + "unsetConfigAdmin" , configAdmin ) ; SibTr . exit ( tc , CLASS_NAME + "unsetConfigAdmin" ) ; }
|
Unbinding the Configuration Admin service
|
35,639
|
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
|
35,640
|
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
|
35,641
|
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
|
35,642
|
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 ; users = createUserOrGroupSet ( roleProperties , MessagingSecurityConstants . USER ) ; 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
|
35,643
|
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
|
35,644
|
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
|
35,645
|
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 .
|
35,646
|
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 .
|
35,647
|
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 .
|
35,648
|
protected void initSpecialArrays ( ) { int len = getByteArray ( ) . length ; 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 .
|
35,649
|
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 .
|
35,650
|
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 .
|
35,651
|
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." ) ; } } 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 .
|
35,652
|
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 .
|
35,653
|
private static int getAvailableProcessorsFromFilesystem ( ) { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; Double availableProcessorsDouble = null ; int availableProcessorsInt = - 1 ; 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 ( ) ) { try { String quotaContents = readFile ( cfsQuota ) ; double quotaFloat = new Double ( quotaContents ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "quotaFloat = " + quotaFloat ) ; if ( quotaFloat >= 0 ) { 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 ( ) ; if ( availableProcessorsDouble != null && availableProcessorsDouble > availableProcessorsInt ) availableProcessorsInt ++ ; return availableProcessorsInt ; }
|
utility below parses cpu limits info from Docker files
|
35,654
|
public static void processAllEntryProbeExtensions ( Event event , RequestContext requestContext ) { if ( event == requestContext . getRootEvent ( ) ) { requestContext . setRequestContextIndex ( activeRequests . add ( requestContext ) ) ; } List < ProbeExtension > probeExtnList = RequestProbeService . getProbeExtensions ( ) ; for ( int i = 0 ; i < probeExtnList . size ( ) ; i ++ ) { ProbeExtension probeExtension = probeExtnList . get ( i ) ; try { if ( probeExtension . invokeForEventEntry ( ) ) { 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
|
35,655
|
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 { if ( probeExtension . invokeForEventExit ( ) ) { 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 ( ) ) { try { RequestContext storedRequestContext = activeRequests . get ( requestContext . getRequestContextIndex ( ) ) ; if ( storedRequestContext != null && ( storedRequestContext . getRequestId ( ) == requestContext . getRequestId ( ) ) ) activeRequests . remove ( requestContext . getRequestContextIndex ( ) ) ; } catch ( ArrayIndexOutOfBoundsException e ) { } } }
|
Iterate through all the probe extensions and process all the exit method of the available probe extension
|
35,656
|
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 { 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
|
35,657
|
@ Reference ( name = KEY_SECURITY_SERVICE , policy = ReferencePolicy . DYNAMIC ) protected void setSecurityService ( SecurityService securitysvc ) { securityService = securitysvc ; }
|
serviceReferences are bad avoid and do this instead .
|
35,658
|
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 .
|
35,659
|
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 ( ) } ) ; 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 .
|
35,660
|
public static synchronized boolean setRunAsSubject ( Subject subj ) { Subject before = null ; try { before = getRunAsSubject ( ) ; final Subject fsubj = subj ; AccessController . doPrivileged ( new PrivilegedExceptionAction < Object > ( ) { 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 .
|
35,661
|
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 ) { 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 .
|
35,662
|
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
|
35,663
|
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 ) ; files = null ; } if ( maxFiles <= 0 ) { files = null ; } else { if ( files == null ) { files = new ArrayList < String > ( ) ; String [ ] existing = LoggingFileUtils . safelyFindFiles ( directory , filePattern ) ; if ( existing != null ) { Arrays . sort ( existing , NaturalComparator . instance ) ; files . addAll ( Arrays . asList ( existing ) ) ; } } int maxTrackedFiles = getMaxDateFiles ( ) ; while ( files . size ( ) > maxTrackedFiles ) { removeFile ( 0 ) ; } 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 .
|
35,664
|
private void addFile ( int index , String file ) { if ( maxFiles > 0 ) { int numFiles = files . size ( ) ; int maxDateFiles = getMaxDateFiles ( ) ; if ( maxDateFiles <= 0 || numFiles < maxDateFiles ) { files . add ( index , file ) ; } else { 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 .
|
35,665
|
protected JsJmsMessage instantiateMessage ( ) throws Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "instantiateMessage" ) ; JsJmsMessage newMsg = jmfact . createJmsMessage ( ) ; messageClass = CLASS_NONE ; 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 .
|
35,666
|
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 .
|
35,667
|
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 .
|
35,668
|
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 .
|
35,669
|
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 .
|
35,670
|
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 .
|
35,671
|
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 .
|
35,672
|
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 .
|
35,673
|
void clearLocalProperties ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "clearLocalProperties" ) ; if ( locallyStoredPropertyValues != null ) locallyStoredPropertyValues . clear ( ) ; localJMSMessageID = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "clearLocalProperties" ) ; }
|
Clear special case properties held in this message . Invoked at send time .
|
35,674
|
void invalidateToStringCache ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "invalidateToStringCache" ) ; 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 .
|
35,675
|
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 , 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 .
|
35,676
|
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 ; 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 .
|
35,677
|
@ 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 ) { 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 .
|
35,678
|
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
|
35,679
|
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 .
|
35,680
|
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 .
|
35,681
|
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
|
35,682
|
private Set getDestinationLocalitySet ( BaseDestinationHandler destinationHandler , Capability capability ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getDestinationLocalitySet" , new Object [ ] { destinationHandler , capability } ) ; Set localitySet = null ; try { localitySet = _messageProcessor . getSIBDestinationLocalitySet ( null , destinationHandler . getUuid ( ) . toString ( ) , true ) ; } catch ( SIBExceptionBase e ) { 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 .
|
35,683
|
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 } ) ; try { ptoPMessageItemStream . markAsToBeDeleted ( _txManager . createAutoCommitTransaction ( ) ) ; destinationHandler . closeRemoteConsumer ( meUuid ) ; } catch ( SIResourceException e ) { 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 .
|
35,684
|
private void compareToAparList ( ExecutionContext context , CommandConsole console , Map < String , Set < String > > installedIFixes , File wlpInstallationDirectory ) { String aparListString = context . getOptionValue ( APAR_TO_COMPARE_OPTION ) ; List < String > aparList ; aparListString = aparListString . trim ( ) ; if ( aparListString . isEmpty ( ) ) { aparList = Collections . emptyList ( ) ; } else { 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 ) ; } } } Set < String > aparsInstalled = null ; try { aparsInstalled = findFixPackAparIds ( wlpInstallationDirectory , console , context ) ; } catch ( IllegalArgumentException e ) { 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 ; } aparsInstalled . addAll ( installedIFixes . keySet ( ) ) ; List < String > missingApars = new ArrayList < String > ( ) ; for ( String apar : aparList ) { if ( ! aparsInstalled . contains ( apar ) ) { missingApars . add ( apar ) ; } } if ( missingApars . isEmpty ( ) ) { console . printlnInfoMessage ( getMessage ( "compare.all.apars.present" ) ) ; } else { console . printlnInfoMessage ( getMessage ( "compare.missing.apars" , missingApars . toString ( ) ) ) ; } }
|
Compares the current install to a list of APARs in the console arguments
|
35,685
|
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 ) { 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 ; } 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 ( ) ) ; } } 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 ) ; } 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
|
35,686
|
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
|
35,687
|
private Version getProductVersion ( File wlpInstallationDirectory ) throws VersionParsingException { Map < String , ProductInfo > productProperties = VersionUtils . getAllProductInfo ( wlpInstallationDirectory ) ; 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
|
35,688
|
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 .
|
35,689
|
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 .
|
35,690
|
public ModuleItem find ( String name ) { if ( children == null ) return null ; else return ( ModuleItem ) children . get ( name ) ; }
|
Find an immediate child
|
35,691
|
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
|
35,692
|
public synchronized ModuleItem add ( String [ ] path , int index ) { if ( path == null ) return null ; if ( path . length == 0 ) return this ; ModuleItem item = find ( path [ index ] ) ; if ( item == null ) { String [ ] myPath = new String [ index + 1 ] ; System . arraycopy ( path , 0 , myPath , 0 , myPath . length ) ; if ( myPath . length == 1 ) { ModuleAggregate aggregate = new ModuleAggregate ( myPath [ 0 ] ) ; item = find ( path [ index ] ) ; } else if ( myPath . length == 3 ) { new ModuleAggregate ( myPath [ 0 ] , myPath [ 1 ] , myPath [ 2 ] ) ; item = find ( path [ index ] ) ; } else { Tr . warning ( tc , "PMI9999E" , "Parent module not found." ) ; } 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
|
35,693
|
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?
|
35,694
|
public synchronized void remove ( ModuleItem item ) { if ( item == null || children == null ) return ; PmiModule removeInstance = item . getInstance ( ) ; if ( ! ( removeInstance instanceof PmiModuleAggregate ) ) { ModuleItem myParent = this ; PmiModule parModule = null ; while ( myParent != null ) { parModule = myParent . getInstance ( ) ; if ( parModule != null && parModule instanceof PmiModuleAggregate ) ( ( PmiModuleAggregate ) parModule ) . remove ( removeInstance ) ; myParent = myParent . getParent ( ) ; } } item . _cleanChildren ( ) ; children . remove ( item . getInstance ( ) . getName ( ) ) ; if ( myStatsWithChildren != null ) { updateStatsTree ( ) ; } item . getInstance ( ) . cleanup ( ) ; item = null ; }
|
Remove a child from it - synchronized
|
35,695
|
public DataDescriptor [ ] listMembers ( DataDescriptor dd , boolean jmxBased ) { SpdData [ ] dataList = null ; int dataLength = 0 ; if ( ! jmxBased ) { dataList = instance . listData ( ) ; if ( dataList != null ) dataLength = dataList . length ; } 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 ] ; } } 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
|
35,696
|
public StatsImpl getStats ( boolean recursive ) { if ( recursive ) { if ( myStatsWithChildren == null ) { ArrayList dataMembers = null ; if ( instance != null ) dataMembers = instance . listStatistics ( ) ; ArrayList colMembers = null ; 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 ( ) ) ; } return myStatsWithChildren ; } 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 ( ) ; myStats . setTime ( System . currentTimeMillis ( ) ) ; } return myStats ; } }
|
is updated .
|
35,697
|
private void setInstanceLevel_FG ( int [ ] enabled , int [ ] enabledSync , boolean recursive ) { if ( instance != null ) { boolean action = instance . setFineGrainedInstrumentation ( enabled , enabledSync ) ; 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
|
35,698
|
private void _cleanChildren ( ) { if ( children != null ) { Iterator values = children . values ( ) . iterator ( ) ; while ( values . hasNext ( ) ) { ModuleItem remMI = ( ModuleItem ) values . next ( ) ; remMI . getInstance ( ) . cleanup ( ) ; remMI . _cleanChildren ( ) ; remMI = null ; } children . clear ( ) ; } }
|
recursively remove reference to child ModuleItem from children ArrayList
|
35,699
|
protected void configureCustomizeBinding ( Client client , QName portName ) { 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 ) ) ; client . getOutInterceptors ( ) . add ( new LibertyCustomizeBindingOutEndingInterceptor ( wsrInfo ) ) ; }
|
Add the LibertyCustomizeBindingOutInterceptor in the out interceptor chain .
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.