idx
int64 0
165k
| question
stringlengths 73
4.15k
| target
stringlengths 5
918
| len_question
int64 21
890
| len_target
int64 3
255
|
|---|---|---|---|---|
163,000
|
private void handleGenericHNIError ( Throwable t , HttpInboundServiceContextImpl hisc ) { hisc . setHeadersParsed ( ) ; sendErrorMessage ( t ) ; setPartiallyParsed ( false ) ; }
|
the same thing so now they will just call this one method
| 53
| 12
|
163,001
|
private void handleNewRequest ( ) { // if this is an http/2 request, skip to discrimination if ( ! isAlpnHttp2Link ( this . vc ) ) { final HttpInboundServiceContextImpl sc = getHTTPContext ( ) ; // save the request info that was parsed in case somebody changes it sc . setRequestVersion ( sc . getRequest ( ) . getVersionValue ( ) ) ; sc . setRequestMethod ( sc . getRequest ( ) . getMethodValue ( ) ) ; // get the response message initialized. Note: in the proxy env, this // response message will be overwritten; however, this is the only // spot to init() it correctly for all other cases. sc . getResponseImpl ( ) . init ( sc ) ; this . numRequestsProcessed ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Received request number " + this . numRequestsProcessed + " on link " + this ) ; } // check for the 100-continue scenario if ( ! sc . check100Continue ( ) ) { return ; } } handleDiscrimination ( ) ; }
|
Process a new request message updating internal stats and calling the discrimination to pass it along the channel chain .
| 253
| 20
|
163,002
|
private void sendErrorMessage ( Throwable t ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Sending a 400 for throwable [" + t + "]" ) ; } sendErrorMessage ( StatusCodes . BAD_REQUEST ) ; }
|
Send an error message when a generic throwable occurs .
| 71
| 11
|
163,003
|
private void sendErrorMessage ( StatusCodes code ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Sending an error page back [code: " + code + "]" ) ; } try { getHTTPContext ( ) . sendError ( code . getHttpError ( ) ) ; } catch ( MessageSentException mse ) { // no FFDC required close ( getVirtualConnection ( ) , new Exception ( "HTTP Message failure" ) ) ; } }
|
Send an error message back to the client with a defined status code instead of an exception .
| 115
| 18
|
163,004
|
private void handlePipeLining ( ) { HttpServiceContextImpl sc = getHTTPContext ( ) ; WsByteBuffer buffer = sc . returnLastBuffer ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Pipelined request found: " + buffer ) ; } sc . clear ( ) ; // save it back so that we always release it sc . storeAllocatedBuffer ( buffer ) ; sc . disableBufferModification ( ) ; EventEngine events = HttpDispatcher . getEventService ( ) ; if ( null != events ) { Event event = events . createEvent ( HttpPipelineEventHandler . TOPIC_PIPELINING ) ; event . setProperty ( CallbackIDs . CALLBACK_HTTPICL . getName ( ) , this ) ; events . postEvent ( event ) ; } else { // unable to dispatch work request, continue on this thread ready ( getVirtualConnection ( ) ) ; } }
|
Handle a pipelined request discovered while closing the handling of the last request .
| 219
| 16
|
163,005
|
@ Override public void error ( VirtualConnection inVC , Throwable t ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "error() called on " + this + " " + inVC ) ; } try { close ( inVC , ( Exception ) t ) ; } catch ( ClassCastException cce ) { // no FFDC required close ( inVC , new Exception ( "Problem when finishing response" ) ) ; } }
|
Called when an error occurs on this connection .
| 109
| 10
|
163,006
|
private boolean checkIfUpgradeHeaders ( Map < String , String > headers ) { // looking for two headers. // connection header with a value of "upgrade" // upgrade header with a value of "h2c" boolean connection_upgrade = false ; boolean upgrade_h2c = false ; String headerValue = null ; Set < Entry < String , String > > headerEntrys = headers . entrySet ( ) ; for ( Entry < String , String > header : headerEntrys ) { String name = header . getKey ( ) ; //check if it's an HTTP2 non-secure upgrade connection. if ( name . equalsIgnoreCase ( CONSTANT_connection ) ) { headerValue = header . getValue ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "connection header found with value: " + headerValue ) ; } if ( headerValue != null && headerValue . equalsIgnoreCase ( CONSTANT_connection_value ) ) { if ( connection_upgrade == true ) { // should not have two of these, log debug and return false // TODO: determine if we should throw an exception here, or if this error will be dealt with in subsequent processing if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "malformed: second connection header found" ) ; } return false ; } connection_upgrade = true ; } } if ( name . equalsIgnoreCase ( CONSTANT_upgrade ) ) { headerValue = header . getValue ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "upgrade header found with value: " + headerValue ) ; } if ( headerValue != null && headerValue . equalsIgnoreCase ( CONSTANT_h2c ) ) { if ( upgrade_h2c == true ) { // should not have two of these, log debug and return false // TODO: determine if we should throw an exception here, or if this error will be dealt with in subsequent processing if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "malformed: second upgrade header found" ) ; } return false ; } upgrade_h2c = true ; } } } if ( connection_upgrade && upgrade_h2c ) { return true ; } return false ; }
|
Determine if a map of headers contains http2 upgrade headers
| 499
| 13
|
163,007
|
@ Override protected LicenseProvider createLicenseProvider ( String licenseAgreementPrefix , String licenseInformationPrefix , String subsystemLicenseType ) { String featureLicenseAgreementPrefix = this . featureName + "/" + licenseAgreementPrefix ; String featureLicenseInformationPrefix = licenseInformationPrefix == null ? null : this . featureName + "/" + licenseInformationPrefix ; if ( featureLicenseInformationPrefix == null ) { LicenseProvider lp = ZipLicenseProvider . createInstance ( zip , featureLicenseAgreementPrefix ) ; if ( lp != null ) return lp ; } else { wlp . lib . extract . ReturnCode licenseReturnCode = ZipLicenseProvider . buildInstance ( zip , featureLicenseAgreementPrefix , featureLicenseInformationPrefix ) ; if ( licenseReturnCode == wlp . lib . extract . ReturnCode . OK ) { // Everything is set up ok so carry on return ZipLicenseProvider . getInstance ( ) ; } } // An error indicates that the IBM licenses could not be found so we can use the subsystem header if ( subsystemLicenseType != null && subsystemLicenseType . length ( ) > 0 ) { return new ThirdPartyLicenseProvider ( featureDefinition . getFeatureName ( ) , subsystemLicenseType ) ; } return null ; }
|
will need to override
| 267
| 4
|
163,008
|
public LocalTransaction createLocalTransaction ( boolean useSingleResourceOnly ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createLocalTransaction" ) ; LocalTransaction tran = null ; //Venu Removing the createLocalTransactionWithSubordinates() as it has to happen only // in case of PEV resources tran = transactionFactory . createLocalTransaction ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createLocalTransaction" , tran ) ; return tran ; }
|
Creates a local transaction .
| 140
| 6
|
163,009
|
public ExternalAutoCommitTransaction createAutoCommitTransaction ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createAutoCommitTransaction" ) ; ExternalAutoCommitTransaction transaction = transactionFactory . createAutoCommitTransaction ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createAutoCommitTransaction" , transaction ) ; return transaction ; }
|
Creates a Auto Commit Transaction
| 114
| 6
|
163,010
|
public SIXAResource createXAResource ( boolean useSingleResource ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createXAResource" , new Boolean ( useSingleResource ) ) ; SIXAResource resource = null ; //get the message store resource resource = transactionFactory . createXAResource ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createXAResource" , resource ) ; return resource ; }
|
Creates an XA transaction resource
| 136
| 7
|
163,011
|
public Object createObjectCache ( String reference ) { final String methodName = "createCacheInstance()" ; if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , methodName + " cacheName=" + reference ) ; CacheConfig config = ServerCache . getCacheService ( ) . getCacheInstanceConfig ( reference ) ; if ( config == null ) { // DYNA1004E=DYNA1004E: WebSphere Dynamic Cache instance named {0} can not be initialized because it is not // configured. // DYNA1004E.explanation=This message indicates the named WebSphere Dynamic Cache instance can not be // initialized. The named instance is not avaliable. // DYNA1004E.useraction=Use the WebSphere Administrative Console to configure a cache instance resource // named {0}. Tr . error ( tc , "DYNA1004E" , new Object [ ] { reference } ) ; } /* * Sync on the WCCMConfig because multiple cache readers might have entered the createCacheInstance at the same * time. With this sync one reader has to wait till the other has finished creating the cache instance */ DistributedObjectCache dCache = null ; synchronized ( config ) { // ADDED FOR 378973 if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Entered synchronized (config) for " + config . getCacheName ( ) ) ; } dCache = config . getDistributedObjectCache ( ) ; if ( dCache == null ) { dCache = createDistributedObjectCache ( config ) ; config . setDistributedObjectCache ( dCache ) ; } } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName in=" + reference + " out=" + reference ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , methodName + " distributedObjectCache=" + dCache ) ; return dCache ; }
|
Create a DistributedObjectCache from a string reference . The config for the reference must already exist .
| 420
| 20
|
163,012
|
private DistributedObjectCache createDistributedObjectCache ( CacheConfig config ) { final String methodName = "createDistributedObjectCache()" ; if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , methodName + " cacheName=" + ( config != null ? config . getCacheName ( ) : "null" ) ) ; DCache dCache = ServerCache . createCache ( config . getCacheName ( ) , config ) ; config . setCache ( dCache ) ; DistributedObjectCache distributedObjectCache = null ; if ( config . isEnableNioSupport ( ) ) { distributedObjectCache = new DistributedNioMapImpl ( dCache ) ; } else { distributedObjectCache = new DistributedMapImpl ( dCache ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , methodName + " distributedObjectCache=" + distributedObjectCache ) ; return distributedObjectCache ; }
|
Create a DistributedObjectCache from a cacheConfig object .
| 197
| 12
|
163,013
|
public EventSource createEventSource ( boolean createAsyncEventSource , String cacheName ) { EventSource eventSource = new DCEventSource ( cacheName , createAsyncEventSource ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Using caller thread context for callback - cacheName= " + cacheName ) ; return eventSource ; }
|
This implements the method in the ServletCacheUnit interface . This method is used to initialize event source for invalidation listener
| 76
| 24
|
163,014
|
public static Map < JNDIEnvironmentRefType , Map < String , String > > createAllBindingsMap ( ) { Map < JNDIEnvironmentRefType , Map < String , String > > allBindings = new EnumMap < JNDIEnvironmentRefType , Map < String , String > > ( JNDIEnvironmentRefType . class ) ; for ( JNDIEnvironmentRefType refType : JNDIEnvironmentRefType . VALUES ) { if ( refType . getBindingElementName ( ) != null ) { allBindings . put ( refType , new HashMap < String , String > ( ) ) ; } } return allBindings ; }
|
Create a new map for holding all JNDIEnvironmentRef bindings .
| 143
| 14
|
163,015
|
public static void setAllBndAndExt ( ComponentNameSpaceConfiguration compNSConfig , Map < JNDIEnvironmentRefType , Map < String , String > > allBindings , Map < String , String > envEntryValues , ResourceRefConfigList resRefList ) { for ( JNDIEnvironmentRefType refType : JNDIEnvironmentRefType . VALUES ) { if ( refType . getBindingElementName ( ) != null ) { compNSConfig . setJNDIEnvironmentRefBindings ( refType . getType ( ) , allBindings . get ( refType ) ) ; } } compNSConfig . setEnvEntryValues ( envEntryValues ) ; compNSConfig . setResourceRefConfigList ( resRefList ) ; }
|
Update a ComponentNameSpaceConfiguration object with processed binding and extension metadata .
| 160
| 14
|
163,016
|
public static void chainRequestDispatchers ( RequestDispatcher [ ] dispatchers , HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { for ( int i = 0 ; i < dispatchers . length - 1 ; i ++ ) { ChainedResponse chainedResp = new ChainedResponse ( request , response ) ; dispatchers [ i ] . forward ( request , chainedResp ) ; request = chainedResp . getChainedRequest ( ) ; } dispatchers [ dispatchers . length - 1 ] . forward ( request , response ) ; }
|
Chain the responses of a set of request dispatchers together .
| 127
| 13
|
163,017
|
@ Reference ( name = KEY_GENERATOR , service = DDLGenerationParticipant . class , policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . MULTIPLE ) protected void setGenerator ( ServiceReference < DDLGenerationParticipant > ref ) { generators . addReference ( ref ) ; }
|
Method which registers a DDL generator . All OSGi services providing this interface will be set here .
| 73
| 20
|
163,018
|
@ Override public MetaRuleset createMetaRuleset ( Class type ) { MetaRuleset ruleset = new MetaRulesetImpl ( _delegate . getTag ( ) , type ) ; ruleset . ignore ( "binding" ) ; ruleset . ignore ( "event" ) ; return ruleset ; }
|
This tag call _delegate . setAttributes so the returned MetaRuleset should ignore attributes that are not supposed to be there like binding and event
| 65
| 29
|
163,019
|
public void applyAttachedObject ( FacesContext context , UIComponent parent ) { // Retrieve the current FaceletContext from FacesContext object FaceletContext faceletContext = ( FaceletContext ) context . getAttributes ( ) . get ( FaceletContext . FACELET_CONTEXT_KEY ) ; ValueExpression ve = null ; Behavior behavior = null ; if ( _delegate . getBinding ( ) != null ) { ve = _delegate . getBinding ( ) . getValueExpression ( faceletContext , Behavior . class ) ; behavior = ( Behavior ) ve . getValue ( faceletContext ) ; } if ( behavior == null ) { behavior = this . createBehavior ( faceletContext ) ; if ( ve != null ) { ve . setValue ( faceletContext , behavior ) ; } } if ( behavior == null ) { throw new TagException ( _delegate . getTag ( ) , "No Validator was created" ) ; } _delegate . setAttributes ( faceletContext , behavior ) ; if ( behavior instanceof ClientBehavior ) { // cast to a ClientBehaviorHolder ClientBehaviorHolder cvh = ( ClientBehaviorHolder ) parent ; // TODO: check if the behavior could be applied to the current parent // For run tests it is not necessary, so we let this one pending. // It is necessary to obtain a event name for add it, so we have to // look first to the defined event name, otherwise take the default from // the holder String eventName = getEventName ( ) ; if ( eventName == null ) { eventName = cvh . getDefaultEventName ( ) ; } if ( eventName == null ) { throw new TagAttributeException ( _delegate . getEvent ( ) , "eventName could not be defined for client behavior " + behavior . toString ( ) ) ; } else if ( ! cvh . getEventNames ( ) . contains ( eventName ) ) { throw new TagAttributeException ( _delegate . getEvent ( ) , "eventName " + eventName + " not found on component instance" ) ; } else { cvh . addClientBehavior ( eventName , ( ClientBehavior ) behavior ) ; } AjaxHandler . registerJsfAjaxDefaultResource ( faceletContext , parent ) ; } }
|
Create a ClientBehavior and attach it to the component
| 496
| 11
|
163,020
|
@ FFDCIgnore ( InvocationTargetException . class ) Object getDB ( String databaseName ) throws Exception { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; lock . readLock ( ) . lock ( ) ; try { if ( mongoClient == null ) { // Switch to write lock for lazy initialization lock . readLock ( ) . unlock ( ) ; lock . writeLock ( ) . lock ( ) ; try { if ( mongoClient == null ) init ( ) ; } finally { // Downgrade to read lock for rest of method lock . readLock ( ) . lock ( ) ; lock . writeLock ( ) . unlock ( ) ; } } Object db = MongoClient_getDB . invoke ( mongoClient , databaseName ) ; // authentication String user = ( String ) props . get ( USER ) ; if ( user != null ) { if ( ( Boolean ) DB_isAuthenticated . invoke ( db ) ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "already authenticated" ) ; } else { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "authenticate as: " + user ) ; SerializableProtectedString password = ( SerializableProtectedString ) props . get ( PASSWORD ) ; String pwdStr = password == null ? null : String . valueOf ( password . getChars ( ) ) ; pwdStr = PasswordUtil . getCryptoAlgorithm ( pwdStr ) == null ? pwdStr : PasswordUtil . decode ( pwdStr ) ; char [ ] pwdChars = pwdStr == null ? null : pwdStr . toCharArray ( ) ; try { if ( ! ( Boolean ) DB_authenticate . invoke ( db , user , pwdChars ) ) if ( ( Boolean ) DB_isAuthenticated . invoke ( db ) ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "another thread must have authenticated first" ) ; } else throw new IllegalArgumentException ( Tr . formatMessage ( tc , "CWKKD0012.authentication.error" , MONGO , id , databaseName ) ) ; } catch ( InvocationTargetException x ) { // If already authenticated, Mongo raises: // IllegalStateException: can't authenticate twice on the same database // Maybe another thread did the authentication right after we checked, so check again. Throwable cause = x . getCause ( ) ; if ( cause instanceof IllegalStateException && ( Boolean ) DB_isAuthenticated . invoke ( db ) ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "another thread must have authenticated first" , cause ) ; } else throw cause ; } } } else if ( useCertAuth ) { // If we specified a certificate we will already have used the client constructor that // specified the credential so if we have got to here we are already authenticated and // JIT should remove this so it will not be an overhead. } return db ; } catch ( Throwable x ) { // rethrowing the exception allows it to be captured in FFDC and traced automatically x = x instanceof InvocationTargetException ? x . getCause ( ) : x ; if ( x instanceof Exception ) throw ( Exception ) x ; else if ( x instanceof Error ) throw ( Error ) x ; else throw new RuntimeException ( x ) ; } finally { lock . readLock ( ) . unlock ( ) ; } }
|
Get a Mongo DB instance authenticated with the specified user and password if specified .
| 758
| 15
|
163,021
|
private String getCerticateSubject ( AtomicServiceReference < Object > serviceRef , Properties sslProperties ) { String certificateDN = null ; try { certificateDN = sslHelper . getClientKeyCertSubject ( serviceRef , sslProperties ) ; } catch ( KeyStoreException ke ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . error ( tc , "CWKKD0020.ssl.get.certificate.user" , MONGO , id , ke ) ; } throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0020.ssl.get.certificate.user" , MONGO , id , ke ) ) ; } catch ( CertificateException ce ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . error ( tc , "CWKKD0020.ssl.get.certificate.user" , MONGO , id , ce ) ; } throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0020.ssl.get.certificate.user" , MONGO , id , ce ) ) ; } // handle null .... cannot find the client key if ( certificateDN == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . error ( tc , "CWKKD0026.ssl.certificate.exception" , MONGO , id ) ; } throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0026.ssl.certificate.exception" , MONGO , id ) ) ; } return certificateDN ; }
|
Call security code to read the subject name from the key in the keystore
| 364
| 15
|
163,022
|
@ FFDCIgnore ( Throwable . class ) @ Trivial private void set ( Class < ? > MongoClientOptions_Builder , Object optionsBuilder , String propName , Object value ) throws IntrospectionException , IllegalArgumentException , IllegalAccessException , InvocationTargetException { try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , propName + ' ' + value ) ; Class < ? > type = MONGO_CLIENT_OPTIONS_TYPES . get ( propName ) ; // setter methods are just propName, no setPropName. Method method = MongoClientOptions_Builder . getMethod ( propName , type ) ; // even though we told the config service that some of these props are Integers, they get converted to longs. Need // to convert them back to int so that our .invoke(..) method doesn't blow up. if ( type . equals ( int . class ) && value instanceof Long ) { value = ( ( Long ) value ) . intValue ( ) ; } method . invoke ( optionsBuilder , value ) ; return ; } catch ( Throwable x ) { if ( x instanceof InvocationTargetException ) x = x . getCause ( ) ; IllegalArgumentException failure = ignoreWarnOrFail ( x , IllegalArgumentException . class , "CWKKD0010.prop.error" , propName , MONGO , id , x ) ; if ( failure != null ) { FFDCFilter . processException ( failure , getClass ( ) . getName ( ) , "394" , this , new Object [ ] { value == null ? null : value . getClass ( ) , value } ) ; throw failure ; } } }
|
Configure a mongo option .
| 377
| 7
|
163,023
|
@ FFDCIgnore ( Throwable . class ) @ Trivial private void setReadPreference ( Class < ? > MongoClientOptions_Builder , Object optionsBuilder , String creatorMethod ) throws ClassNotFoundException , IllegalArgumentException , SecurityException , IllegalAccessException , InvocationTargetException , NoSuchMethodException { try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , READ_PREFERENCE + ' ' + creatorMethod ) ; Class < ? > ReadPreference = MongoClientOptions_Builder . getClassLoader ( ) . loadClass ( "com.mongodb.ReadPreference" ) ; // Calls static ReadPreference.nearest() (or whatever conf is set to) to get a ReadPreference object Object readPreference = ReadPreference . getMethod ( creatorMethod ) . invoke ( ReadPreference ) ; // Set static ReadPreference on Builder. MongoClientOptions_Builder . getMethod ( "readPreference" , ReadPreference ) . invoke ( optionsBuilder , readPreference ) ; } catch ( Throwable x ) { if ( x instanceof InvocationTargetException ) x = x . getCause ( ) ; IllegalArgumentException failure = ignoreWarnOrFail ( x , IllegalArgumentException . class , "CWKKD0010.prop.error" , READ_PREFERENCE , MONGO , id , x ) ; if ( failure != null ) { FFDCFilter . processException ( failure , getClass ( ) . getName ( ) , "422" , this ) ; throw failure ; } } }
|
Configure the readPreference mongo option which is a special case .
| 347
| 15
|
163,024
|
@ FFDCIgnore ( Throwable . class ) @ Trivial private void setWriteConcern ( Class < ? > MongoClientOptions_Builder , Object optionsBuilder , String fieldName ) throws ClassNotFoundException , IllegalArgumentException , SecurityException , IllegalAccessException , InvocationTargetException , NoSuchMethodException { try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , WRITE_CONCERN + ' ' + fieldName ) ; Class < ? > WriteConcern = MongoClientOptions_Builder . getClassLoader ( ) . loadClass ( "com.mongodb.WriteConcern" ) ; // Set value to the static class value Object writeConcern = WriteConcern . getField ( fieldName ) . get ( null ) ; MongoClientOptions_Builder . getMethod ( "writeConcern" , WriteConcern ) . invoke ( optionsBuilder , writeConcern ) ; } catch ( Throwable x ) { if ( x instanceof InvocationTargetException ) x = x . getCause ( ) ; IllegalArgumentException failure = ignoreWarnOrFail ( x , IllegalArgumentException . class , "CWKKD0010.prop.error" , WRITE_CONCERN , MONGO , id , x ) ; if ( failure != null ) { FFDCFilter . processException ( failure , getClass ( ) . getName ( ) , "422" , this ) ; throw failure ; } } }
|
Configure the writeConcern mongo option which is a special case .
| 319
| 15
|
163,025
|
protected void setSsl ( ServiceReference < Object > reference ) { sslConfigurationRef . setReference ( reference ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "sslRef set to " + reference . getProperty ( CONFIG_DISPLAY_ID ) ) ; } }
|
Declarative Services method for setting the SSL Support service reference
| 78
| 12
|
163,026
|
protected void unsetSsl ( ServiceReference < Object > reference ) { sslConfigurationRef . unsetReference ( reference ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "sslRef unset" ) ; } }
|
Declarative Services method for unsetting the SSL Support service reference
| 67
| 13
|
163,027
|
private void assertValidSSLConfig ( ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; boolean sslEnabled = ( ( ( Boolean ) props . get ( SSL_ENABLED ) ) == null ) ? false : ( Boolean ) props . get ( SSL_ENABLED ) ; boolean sslRefExists = ( ( props . get ( SSL_REF ) ) == null ) ? false : true ; if ( sslRefExists && ! sslEnabled ) { if ( trace && tc . isDebugEnabled ( ) ) { // sslRef property set in the server.xml but sslEnabled not set to true. Tr . error ( tc , "CWKKD0024.ssl.sslref.no.ssl" , MONGO , id ) ; } throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0024.ssl.sslref.no.ssl" , MONGO , id ) ) ; } if ( sslEnabled ) { // we should have the ssl-1.0 feature selected if ( sslHelper == null ) { throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0015.ssl.feature.missing" , MONGO , id ) ) ; } if ( useCertAuth ) { if ( ! sslEnabled ) { // SSL not enabled, so shouldn't be using certificate authentication throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0019.ssl.certificate.no.ssl" , MONGO , id ) ) ; } if ( props . get ( USER ) != null || props . get ( PASSWORD ) != null ) { // shouldn't be using userid and pasword with certificate authentication throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0018.ssl.user.pswd.certificate" , MONGO , id ) ) ; } } } }
|
Validate combination of security parameters for certificate authentication . If useCertificateAuthentication is specified SSL must be enabled an ssslRef must be specified and user and password should not be specified .
| 410
| 38
|
163,028
|
@ Sensitive public String getReferrerURLFromCookies ( HttpServletRequest req , String cookieName ) { Cookie [ ] cookies = req . getCookies ( ) ; String referrerURL = CookieHelper . getCookieValue ( cookies , cookieName ) ; if ( referrerURL != null ) { StringBuffer URL = req . getRequestURL ( ) ; referrerURL = decodeURL ( referrerURL ) ; referrerURL = restoreHostNameToURL ( referrerURL , URL . toString ( ) ) ; } return referrerURL ; }
|
Retrieve the referrer URL from the HttpServletRequest s cookies . This will decode the URL and restore the host name if it was removed .
| 119
| 31
|
163,029
|
public void clearReferrerURLCookie ( HttpServletRequest req , HttpServletResponse res , String cookieName ) { String url = CookieHelper . getCookieValue ( req . getCookies ( ) , cookieName ) ; if ( url != null && url . length ( ) > 0 ) { invalidateReferrerURLCookie ( req , res , cookieName ) ; } }
|
Removes the referrer URL cookie from the HttpServletResponse if set in the HttpServletRequest .
| 84
| 24
|
163,030
|
public void setReferrerURLCookie ( HttpServletRequest req , AuthenticationResult authResult , String url ) { //PM81345: If the URL contains favicon, then we will not update the value of the ReffererURL. The only way //we will do it, is if the value of the cookie is null. This will solve the Error 500. if ( url . contains ( "/favicon.ico" ) && CookieHelper . getCookieValue ( req . getCookies ( ) , REFERRER_URL_COOKIENAME ) != null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Will not update the WASReqURL cookie" ) ; } else { if ( ! webAppSecConfig . getPreserveFullyQualifiedReferrerUrl ( ) ) { url = removeHostNameFromURL ( url ) ; } url = encodeURL ( url ) ; authResult . setCookie ( createReferrerUrlCookie ( req , url ) ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "set " + REFERRER_URL_COOKIENAME + " cookie into AuthenticationResult." ) ; Tr . debug ( tc , "setReferrerURLCookie" , "Referrer URL cookie set " + url ) ; } } }
|
Sets the referrer URL cookie into the AuthenticationResult . If PRESERVE_FULLY_QUALIFIED_REFERRER_URL is not set or set to false then the host name of the referrer URL is removed .
| 291
| 50
|
163,031
|
@ FFDCIgnore ( Exception . class ) private boolean checkDataSource ( DataSource nonTranDataSource ) { boolean fullyFormedDS = false ; try { nonTranDataSource = ( DataSource ) _dataSourceFactory . createResource ( null ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Non Tran dataSource is " + nonTranDataSource ) ; Connection conn = nonTranDataSource . getConnection ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Established connection " + conn ) ; DatabaseMetaData mdata = conn . getMetaData ( ) ; String dbName = mdata . getDatabaseProductName ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Database name " + dbName ) ; String dbVersion = mdata . getDatabaseProductVersion ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Database version " + dbVersion ) ; fullyFormedDS = true ; } catch ( Exception e ) { // We will catch an exception if the DataSource is not yet fully formed if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Caught exception: " + e ) ; } return fullyFormedDS ; }
|
See whether it is possible to get a connection and metatdata from a DataSOurce .
| 282
| 20
|
163,032
|
public void bytes ( Object source , Class sourceClass , byte [ ] data ) { internalBytes ( source , sourceClass , data , 0 , 0 ) ; }
|
Byte data trace .
| 33
| 4
|
163,033
|
public final void entry ( Class sourceClass , String methodName ) { internalEntry ( null , sourceClass , methodName , null ) ; }
|
Method entry tracing for static classes .
| 29
| 7
|
163,034
|
public final void exit ( Class sourceClass , String methodName ) { internalExit ( null , sourceClass , methodName , null ) ; }
|
Method exit tracing for static methods .
| 29
| 7
|
163,035
|
private final void internalExit ( Object source , Class sourceClass , String methodName , Object object ) { StringBuffer stringBuffer = new StringBuffer ( ) ; stringBuffer . append ( methodName ) ; stringBuffer . append ( " [" ) ; if ( source != null ) { stringBuffer . append ( source ) ; } else { stringBuffer . append ( "Static" ) ; } stringBuffer . append ( "]" ) ; if ( object != null ) { SibTr . exit ( traceComponent , stringBuffer . toString ( ) , object ) ; } else { SibTr . exit ( traceComponent , stringBuffer . toString ( ) ) ; } if ( usePrintWriterForTrace ) { java . io . PrintWriter printWriter = traceFactory . getPrintWriter ( ) ; if ( printWriter != null ) { printWriter . print ( new java . util . Date ( ) + " < " ) ; printWriter . print ( sourceClass . getName ( ) ) ; printWriter . print ( "." ) ; printWriter . println ( stringBuffer . toString ( ) ) ; if ( object != null ) { if ( object instanceof Object [ ] ) { Object [ ] objects = ( Object [ ] ) object ; for ( int i = 0 ; i < objects . length ; i ++ ) { printWriter . println ( "\t\t" + objects [ i ] ) ; } } else { printWriter . println ( "\t\t" + object ) ; } } printWriter . flush ( ) ; } } }
|
Internal implementation of method exit tracing .
| 322
| 7
|
163,036
|
public final void event ( Class sourceClass , String methodName , Throwable throwable ) { internalEvent ( null , sourceClass , methodName , throwable ) ; }
|
Event tracing when a throwable is caught in a static class .
| 35
| 13
|
163,037
|
public final void event ( Object source , Class sourceClass , String methodName , Throwable throwable ) { internalEvent ( source , sourceClass , methodName , throwable ) ; }
|
Event tracing .
| 38
| 3
|
163,038
|
private final void internalEvent ( Object source , Class sourceClass , String methodName , Throwable throwable ) { StringBuffer stringBuffer = new StringBuffer ( ) ; stringBuffer . append ( methodName ) ; stringBuffer . append ( " [" ) ; if ( source != null ) { stringBuffer . append ( source ) ; } else { stringBuffer . append ( "Static" ) ; } stringBuffer . append ( "]" ) ; if ( throwable != null ) { SibTr . event ( traceComponent , stringBuffer . toString ( ) , new Object [ ] { "Exception caught: " , throwable } ) ; } else { SibTr . event ( traceComponent , stringBuffer . toString ( ) ) ; } if ( usePrintWriterForTrace ) { java . io . PrintWriter printWriter = traceFactory . getPrintWriter ( ) ; if ( printWriter != null ) { printWriter . print ( new java . util . Date ( ) + " E " ) ; printWriter . print ( sourceClass . getName ( ) ) ; printWriter . print ( "." ) ; printWriter . println ( stringBuffer . toString ( ) ) ; if ( throwable != null ) { throwable . printStackTrace ( printWriter ) ; } printWriter . flush ( ) ; } } }
|
Internal implementation of event tracing .
| 276
| 6
|
163,039
|
public final void info ( Class sourceClass , String methodName , String messageIdentifier , Object object ) { internalInfo ( null , sourceClass , methodName , messageIdentifier , object ) ; }
|
Method information tracing for static objects .
| 41
| 7
|
163,040
|
public final void warning ( Class sourceClass , String methodName , String messageIdentifier , Object object ) { internalWarning ( null , sourceClass , methodName , messageIdentifier , object ) ; }
|
Method warning tracing for static objects .
| 41
| 7
|
163,041
|
public void overrideCacheConfig ( Properties properties ) { if ( properties != null ) { FieldInitializer . initFromSystemProperties ( this , properties ) ; } processOffloadDirectory ( ) ; if ( ! this . enableServletSupport ) { this . disableTemplatesSupport = true ; } }
|
used by com . ibm . ws . cache . spi . DistributedMapFactory
| 62
| 19
|
163,042
|
public void determineCacheProvider ( ) { this . defaultProvider = true ; if ( cacheProviderName . equals ( "" ) ) { cacheProviderName = CacheConfig . CACHE_PROVIDER_DYNACACHE ; } if ( ! cacheProviderName . equals ( CACHE_PROVIDER_DYNACACHE ) ) { defaultProvider = false ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Alternate CacheProvider " + cacheProviderName + " set for " + cacheName ) ; } } }
|
Determines if default cache provider is being used and sets flag accordingly .
| 117
| 15
|
163,043
|
public void resetProvider ( String cacheName ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Reverting to the default Dynacache cache provider" ) ; } this . cacheProviderName = CACHE_PROVIDER_DYNACACHE ; this . enableCacheReplication = false ; this . defaultProvider = true ; this . cacheName = cacheName ; }
|
only called when the alternate cache provider could not create the cache .. we need to then revert to the default
| 87
| 21
|
163,044
|
void restoreDynacacheProviderDefaults ( ) { // restore commonConfig to Dynacache defaults if ( restoreDynacacheDefaults ) { if ( cacheProviderName != CacheConfig . CACHE_PROVIDER_DYNACACHE ) { cacheProviderName = CacheConfig . CACHE_PROVIDER_DYNACACHE ; enableCacheReplication = false ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "OVERRIDING Object Grid default for " + cacheName ) ; } } } }
|
This method reverts the common configuration template for all cache instances to use Dynaache defaults . This method only comes into play when ObjectGrid is configured as the cache provider for the default cache .
| 118
| 39
|
163,045
|
public String pluginId ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "pluginId" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "pluginId" , _pluginId ) ; return _pluginId ; }
|
Returns the pluginId associated with this type of log
| 63
| 10
|
163,046
|
public Properties properties ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "propertis" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "properties" , _props ) ; return _props ; }
|
Returns the set of properties associated with this log implementation
| 62
| 10
|
163,047
|
public ResourceFactory resourceFactory ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "resourceFactory" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resourceFactory" , _resourceFactory ) ; return _resourceFactory ; }
|
Returns the Resource Factory associated with this log implementation
| 64
| 9
|
163,048
|
protected void loadCipherToBit ( ) { boolean keySizeFromCipherMap = Boolean . valueOf ( WebContainer . getWebContainerProperties ( ) . getProperty ( "com.ibm.ws.webcontainer.keysizefromciphermap" , "true" ) ) . booleanValue ( ) ; //721610 if ( keySizeFromCipherMap ) { this . getKeySizefromCipherMap ( "toLoad" ) ; // this will load the Map with values } else { Properties cipherToBitProps = new Properties ( ) ; // load the ssl cipher suite bit sizes property file try { String fileName = System . getProperty ( "server.root" ) + File . separator + "properties" + File . separator + "sslbitsizes.properties" ; cipherToBitProps . load ( new FileInputStream ( fileName ) ) ; } catch ( Exception ex ) { logger . logp ( Level . SEVERE , CLASS_NAME , "loadCipherToBit" , "failed.to.load.sslbitsizes.properties " , ex ) ; /* 283348.1 */ com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( ex , CLASS_NAME + ".loadCipherToBit" , "825" , this ) ; } // put the properties into a hash map for unsynch. reference _cipherToBit . putAll ( cipherToBitProps ) ; } }
|
112102 - added method below to fill the cipher to bit size table
| 322
| 14
|
163,049
|
public VirtualHost getVirtualHost ( String targetHost ) throws WebAppHostNotFoundException { Iterator i = requestMapper . targetMappings ( ) ; while ( i . hasNext ( ) ) { RequestProcessor rp = ( RequestProcessor ) i . next ( ) ; if ( rp instanceof VirtualHost ) { VirtualHost vHost = ( VirtualHost ) rp ; if ( targetHost . equalsIgnoreCase ( vHost . getName ( ) ) ) return vHost ; } } return null ; }
|
Method getVirtualHost . Returns null if the input name does not match any configured host .
| 111
| 18
|
163,050
|
private PathInfoHelper removeExtraPathInfo ( String pathInfo ) { if ( pathInfo == null ) return null ; int semicolon = pathInfo . indexOf ( ' ' ) ; if ( semicolon != - 1 ) { String tmpPathInfo = pathInfo . substring ( 0 , semicolon ) ; String extraPathInfo = pathInfo . substring ( semicolon ) ; return new PathInfoHelper ( tmpPathInfo , extraPathInfo ) ; } return new PathInfoHelper ( pathInfo , null ) ; }
|
begin 272738 Duplicate CacheServletWrappers when url - rewriting is enabled WAS . webcontainer
| 112
| 21
|
163,051
|
public static void sendAppUnavailableException ( HttpServletRequest req , HttpServletResponse res ) throws IOException { if ( ( req instanceof SRTServletRequest ) && ( res instanceof SRTServletResponse ) ) { IRequest ireq = ( ( SRTServletRequest ) req ) . getIRequest ( ) ; IResponse ires = ( ( SRTServletResponse ) res ) . getIResponse ( ) ; sendUnavailableException ( ireq , ires ) ; } }
|
and throw a NPE because we couldn t get the application s configuration
| 111
| 14
|
163,052
|
protected static void sendUnavailableException ( IRequest req , IResponse res ) throws IOException { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) //306998.15 logger . logp ( Level . FINE , CLASS_NAME , "sendUnavailableException" , "Inside sendUnavailableException" ) ; res . addHeader ( "Content-Type" , "text/html" ) ; res . setStatusCode ( 503 ) ; //Translated to SRVE0095I: Servlet has become temporarily unavailable for service: {0} String formattedMessage = nls . getFormattedMessage ( "Servlet.has.become.temporarily.unavailable.for.service:.{0}" , new Object [ ] { truncateURI ( req . getRequestURI ( ) ) } , "Servlet has become temporarily unavailable for service" ) ; String output = "<H1>" + formattedMessage + "</H1><BR>" ; byte [ ] outBytes = output . getBytes ( ) ; res . getOutputStream ( ) . write ( outBytes , 0 , outBytes . length ) ; logger . logp ( Level . SEVERE , CLASS_NAME , "sendUnavailableException" , formattedMessage ) ; }
|
582053 change it to protected from private
| 289
| 9
|
163,053
|
@ Test public void MPJwtNoMpJwtConfig_notInWebXML_notInApp ( ) throws Exception { genericLoginConfigVariationTest ( MpJwtFatConstants . LOGINCONFIG_NOT_IN_WEB_XML_SERVLET_NOT_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . LOGINCONFIG_NOT_IN_WEB_XML_SERVLET_NOT_IN_APP , MpJwtFatConstants . MPJWT_APP_CLASS_NO_LOGIN_CONFIG , ExpectedResult . BAD ) ; }
|
login - config does NOT exist in web . xml login - config does NOT exist in the app the mpJwt feature is NOT enabled We should receive a 401 status in an exception
| 138
| 36
|
163,054
|
@ Test public void MPJwtNoMpJwtConfig_notInWebXML_basicInApp ( ) throws Exception { genericLoginConfigVariationTest ( MpJwtFatConstants . LOGINCONFIG_NOT_IN_WEB_XML_SERVLET_BASIC_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . LOGINCONFIG_NOT_IN_WEB_XML_SERVLET_BASIC_IN_APP , MpJwtFatConstants . MPJWT_APP_CLASS_LOGIN_CONFIG_BASIC , ExpectedResult . BAD ) ; }
|
login - config does NOT exist in web . xml login - config does exist in the app but is set to BASIC the mpJwt feature is NOT enabled We should receive a 401 status in an exception
| 144
| 41
|
163,055
|
@ Test public void MPJwtNoMpJwtConfig_formLoginInWebXML_notInApp ( ) throws Exception { genericLoginConfigFormLoginVariationTest ( MpJwtFatConstants . LOGINCONFIG_FORM_LOGIN_IN_WEB_XML_SERVLET_NOT_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . LOGINCONFIG_FORM_LOGIN_IN_WEB_XML_SERVLET_NOT_IN_APP , MpJwtFatConstants . MPJWT_APP_CLASS_LOGIN_CONFIG_FORMLOGININWEBXML_NOTINAPP , UseJWTToken . NO ) ; }
|
login - config does exist in web . xml but is set to FORM_LOGIN login - config does NOT exist in the app the mpJwt feature is NOT enabled We should use FORM_LOGIN
| 161
| 41
|
163,056
|
@ Test public void MPJwtNoMpJwtConfig_formLoginInWebXML_basicInApp ( ) throws Exception { genericLoginConfigFormLoginVariationTest ( MpJwtFatConstants . LOGINCONFIG_FORM_LOGIN_IN_WEB_XML_SERVLET_BASIC_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . LOGINCONFIG_FORM_LOGIN_IN_WEB_XML_SERVLET_BASIC_IN_APP , MpJwtFatConstants . MPJWT_APP_CLASS_LOGIN_CONFIG_FORMLOGININWEBXML_BASICINAPP , UseJWTToken . NO ) ; }
|
login - config does exist in web . xml but is set to FORM_LOGIN login - config does NOT exist in the app but is set to BASIC the mpJwt feature is NOT enabled We should use FORM_LOGIN
| 167
| 47
|
163,057
|
@ Test public void MPJwtNoMpJwtConfig_formLoginInWebXML_mpJwtInApp ( ) throws Exception { genericLoginConfigFormLoginVariationTest ( MpJwtFatConstants . LOGINCONFIG_FORM_LOGIN_IN_WEB_XML_SERVLET_MP_JWT_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . LOGINCONFIG_FORM_LOGIN_IN_WEB_XML_SERVLET_MP_JWT_IN_APP , MpJwtFatConstants . MPJWT_APP_CLASS_LOGIN_CONFIG_FORMLOGININWEBXML_MPJWTINAPP , UseJWTToken . NO ) ; }
|
login - config does exist in web . xml but is set to FORM_LOGIN login - config does exist in the app and is set to MP - JWT the mpJwt feature is NOT enabled We should use FORM_LOGIN
| 171
| 48
|
163,058
|
@ Test public void MPJwtNoMpJwtConfig_mpJwtInWebXML_notInApp ( ) throws Exception { genericLoginConfigVariationTest ( MpJwtFatConstants . LOGINCONFIG_MP_JWT_IN_WEB_XML_SERVLET_NOT_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . LOGINCONFIG_MP_JWT_IN_WEB_XML_SERVLET_NOT_IN_APP , MpJwtFatConstants . MPJWT_APP_CLASS_LOGIN_CONFIG_MPJWTINWEBXML_NOTINAPP , ExpectedResult . BAD ) ; }
|
login - config does exist in web . xml and is set to MP - JWT login - config does NOT exist in the app the mpJwt feature is NOT enabled We should receive a 401 status in an exception
| 157
| 43
|
163,059
|
@ Test public void MPJwtNoMpJwtConfig_mpJwtInWebXML_basicInApp ( ) throws Exception { genericLoginConfigVariationTest ( MpJwtFatConstants . LOGINCONFIG_MP_JWT_IN_WEB_XML_SERVLET_BASIC_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . LOGINCONFIG_MP_JWT_IN_WEB_XML_SERVLET_BASIC_IN_APP , MpJwtFatConstants . MPJWT_APP_CLASS_LOGIN_CONFIG_MPJWTINWEBXML_BASICINAPP , ExpectedResult . BAD ) ; }
|
login - config does exist in web . xml and is set to MP - JWT login - config does exist in the app but is set to BASIC the mpJwt feature is NOT enabled We should receive a 401 status in an exception
| 163
| 48
|
163,060
|
@ Mode ( TestMode . LITE ) @ Test public void MPJwtNoMpJwtConfig_mpJwtInWebXML_mpJwtInApp ( ) throws Exception { genericLoginConfigVariationTest ( MpJwtFatConstants . LOGINCONFIG_MP_JWT_IN_WEB_XML_SERVLET_MP_JWT_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . LOGINCONFIG_MP_JWT_IN_WEB_XML_SERVLET_MP_JWT_IN_APP , MpJwtFatConstants . MPJWT_APP_CLASS_LOGIN_CONFIG_MPJWTINWEBXML_MPJWTINAPP , ExpectedResult . BAD ) ; }
|
login - config does exist in web . xml and is set to MP - JWT login - config does exist in the app and is set to MP - JWT the mpJwt feature is NOT enabled We should receive a 401 status in an exception
| 176
| 50
|
163,061
|
@ Override public void setTopicName ( String tName ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setTopicName" , tName ) ; setDestDiscrim ( tName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setTopicName" ) ; }
|
Set the topicName .
| 107
| 5
|
163,062
|
@ Override public String getTopicSpace ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getTopicSpace" ) ; String result = getDestName ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getTopicSpace" , result ) ; return result ; }
|
Get the topicSpace .
| 106
| 5
|
163,063
|
@ Override public void setTopicSpace ( String tSpace ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setTopicSpace" , tSpace ) ; setDestName ( tSpace ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setTopicSpace" ) ; }
|
Set the topicSpace
| 106
| 4
|
163,064
|
public static void initialise ( AcceptListenerFactory _acceptListenerFactory ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "initalise" ) ; acceptListenerFactory = _acceptListenerFactory ; // Create the maintainer of the configuration. Framework framework = Framework . getInstance ( ) ; if ( framework == null ) { state = State . INITIALISATION_FAILED ; } else { state = State . INITIALISED ; // Extract the chain reference. connectionTracker = new OutboundConnectionTracker ( framework ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "initalise" ) ; }
|
Initialises the server connection manager by getting hold of the framework .
| 169
| 13
|
163,065
|
public static void initialiseAcceptListenerFactory ( AcceptListenerFactory _acceptListenerFactory ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "initialiseAcceptListenerFactory" , _acceptListenerFactory ) ; acceptListenerFactory = _acceptListenerFactory ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "initialiseAcceptListenerFactory" ) ; }
|
Set the AcceptListenerFactory .
| 109
| 6
|
163,066
|
@ Override public List getActiveOutboundMEtoMEConversations ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getActiveOutboundMEtoMEConversations" ) ; List convs = null ; if ( connectionTracker != null ) { convs = connectionTracker . getAllOutboundConversations ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getActiveOutboundMEtoMEConversations" , convs ) ; return convs ; }
|
Obtains a list of active outbound ME to ME conversations in this JVM .
| 150
| 17
|
163,067
|
@ Override public void open ( ) throws InfoStoreException { String methodName = "open" ; try { getClassSource ( ) . open ( ) ; } catch ( ClassSource_Exception e ) { // defect 84235:we are generating multiple Warning/Error messages for each error due to each level reporting them. // Disable the following warning and defer message generation to a higher level. // CWWKC0026W //Tr.warning(tc, "ANNO_INFOSTORE_OPEN1_EXCEPTION", getHashText(), getClassSource().getHashText()); String eMsg = "[ " + getHashText ( ) + " ] Failed to open class source " ; throw InfoStoreException . wrap ( tc , CLASS_NAME , methodName , eMsg , e ) ; } }
|
Open the InfoStore for processing . Primarily this will open the ClassSources attached to this InfoStore which will then allow classes to be accessed .
| 168
| 29
|
163,068
|
public void scanClass ( String className ) throws InfoStoreException { Object [ ] logParms ; if ( tc . isDebugEnabled ( ) ) { logParms = new Object [ ] { getHashText ( ) , className } ; Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Class [ {1} ] ENTER" , logParms ) ) ; } else { logParms = null ; } ClassInfoImpl classInfo = getNonDelayedClassInfo ( className ) ; if ( classInfo != null ) { if ( logParms != null ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Class [ {1} ] RETURN Already loaded" , logParms ) ) ; } return ; } scanNewClass ( className ) ; // throws AnnotationScannerException if ( logParms != null ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Class [ {1} ] RETURN New load" , logParms ) ) ; } }
|
Visitor helpers ...
| 224
| 4
|
163,069
|
@ Override public PackageInfoImpl getPackageInfo ( String name ) { return getClassInfoCache ( ) . getPackageInfo ( name , ClassInfoCache . DO_NOT_FORCE_PACKAGE ) ; }
|
a package info even if an error occurrs .
| 46
| 10
|
163,070
|
private void updateBindings ( Map < String , Object > props ) { // Process the user element processProps ( props , CFG_KEY_USER , users ) ; // Process the user-access-id element processProps ( props , CFG_KEY_USER_ACCESSID , users ) ; // Process the group element processProps ( props , CFG_KEY_GROUP , groups ) ; // Process the group-access-id element processProps ( props , CFG_KEY_GROUP_ACCESSID , groups ) ; }
|
Update the binding sets based on the properties from the configuration .
| 116
| 12
|
163,071
|
public void cancel ( Exception reason ) { // IMPROVEMENT: need to rework how syncs on the future.complete() work. We really should be // syncing here, so we don't do the channel.cancel if the request is processing // future.complete() on another thread at the same time. Should just do a quick // sync, check the future.complete flag, then process only if !complete. That will // also mean we can remove a bunch of redundant checks for complete, but we need to check all // the paths carefully. if ( this . channel == null ) { return ; } synchronized ( this . completedSemaphore ) { if ( ! this . completed ) { try { // this ends up calling future.completed() this . channel . cancel ( this , reason ) ; } catch ( Exception e ) { // Simply swallow the exception } // end try } else { if ( this . channel . readFuture != null ) { this . channel . readFuture . setCancelInProgress ( 0 ) ; } if ( this . channel . writeFuture != null ) { this . channel . writeFuture . setCancelInProgress ( 0 ) ; } } } }
|
Attempts to cancel the operation represented by the AsyncFuture . Cancellation will not succeed if the operation is already complete .
| 247
| 25
|
163,072
|
protected void fireCompletionActions ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "fireCompletionActions" ) ; } if ( this . firstListener != null ) { ICompletionListener listenerToInvoke = this . firstListener ; // reset listener so it can't be inadvertently be called on the next request this . firstListener = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "invoking callback for channel id: " + this . channel . channelIdentifier ) ; } invokeCallback ( listenerToInvoke , this , this . firstListenerState ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "no listener found for event, future: " + this ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "fireCompletionActions" ) ; } }
|
Impl Assumes we are holding the completed sem lock
| 245
| 10
|
163,073
|
protected void throwException ( ) throws InterruptedException , IOException { if ( this . exception instanceof IOException ) { throw ( IOException ) this . exception ; } if ( this . exception instanceof InterruptedException ) { throw ( InterruptedException ) this . exception ; } if ( this . exception instanceof RuntimeException ) { throw ( RuntimeException ) this . exception ; } throw new RuntimeException ( this . exception ) ; }
|
Throws the receiver s exception in its correct class .
| 90
| 11
|
163,074
|
private void internalBytes ( Object source , Class sourceClass , byte [ ] data , int start , int count ) { StringBuffer stringBuffer = new StringBuffer ( ) ; stringBuffer . append ( sourceClass . getName ( ) ) ; stringBuffer . append ( " [" ) ; if ( source != null ) { stringBuffer . append ( source ) ; } else { stringBuffer . append ( "Static" ) ; } stringBuffer . append ( "]" ) ; stringBuffer . append ( ls ) ; if ( data != null ) { if ( count > 0 ) { stringBuffer . append ( formatBytes ( data , start , count , true ) ) ; } else { stringBuffer . append ( formatBytes ( data , start , data . length , true ) ) ; } } else { stringBuffer . append ( "data is null" ) ; } Tr . debug ( traceComponent , stringBuffer . toString ( ) ) ; if ( usePrintWriterForTrace ) { if ( printWriter != null ) { printWriter . print ( new java . util . Date ( ) + " B " ) ; printWriter . println ( stringBuffer . toString ( ) ) ; printWriter . flush ( ) ; } } }
|
Internal implementation of byte data trace .
| 253
| 7
|
163,075
|
public AppConfigurationEntry createAppConfigurationEntry ( JAASLoginModuleConfig loginModule , String loginContextEntryName ) { String loginModuleClassName = loginModule . getClassName ( ) ; LoginModuleControlFlag controlFlag = loginModule . getControlFlag ( ) ; Map < String , Object > options = new HashMap < String , Object > ( ) ; options . putAll ( loginModule . getOptions ( ) ) ; if ( JaasLoginConfigConstants . APPLICATION_WSLOGIN . equals ( loginContextEntryName ) ) { options . put ( WAS_IGNORE_CLIENT_CONTAINER_DD , true ) ; } else { options . put ( WAS_IGNORE_CLIENT_CONTAINER_DD , false ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "loginModuleClassName: " + loginModuleClassName + " options: " + options . toString ( ) + " controlFlag: " + controlFlag . toString ( ) ) ; } AppConfigurationEntry loginModuleEntry = new AppConfigurationEntry ( loginModuleClassName , controlFlag , options ) ; return loginModuleEntry ; }
|
Create an AppConfigurationEntry object for the given JAAS login module
| 258
| 13
|
163,076
|
@ Override public List < AnnotationInfoImpl > getAnnotations ( ) { if ( annotations != null ) { return annotations ; } // Several cases where superclasses contribute no annotations. In // each of these cases case, simply re-use the declared annotations // collection. // // (One case: All of the inheritable superclass annotations is // overridden by the immediate class, is not detected.) ClassInfoImpl useSuperClass = getSuperclass ( ) ; // Null for 'java.lang.Object'; null for interfaces. if ( useSuperClass == null ) { annotations = declaredAnnotations ; return annotations ; } // Retrieve *all* annotations of the superclass. The effect // is to recurse across annotations of all superclasses. List < AnnotationInfoImpl > superAnnos = useSuperClass . getAnnotations ( ) ; if ( superAnnos . isEmpty ( ) ) { annotations = declaredAnnotations ; return annotations ; } Map < String , AnnotationInfoImpl > allAnnotations = new HashMap < String , AnnotationInfoImpl > ( superAnnos . size ( ) + declaredAnnotations . size ( ) , 1.0f ) ; boolean sawInherited = false ; for ( AnnotationInfoImpl superAnno : superAnnos ) { if ( sawInherited = superAnno . isInherited ( ) ) { allAnnotations . put ( superAnno . getAnnotationClassName ( ) , superAnno ) ; } } if ( ! sawInherited ) { annotations = declaredAnnotations ; return annotations ; } // Make sure to add the declared annotations *after* adding the super class // annotations. The immediate declared annotations have precedence. // We could test the number of overwritten annotations against the // number of inherited annotations. That case seems infrequent, and // is not implemented. for ( AnnotationInfoImpl declaredAnno : declaredAnnotations ) { AnnotationInfoImpl overwrittenAnno = allAnnotations . put ( declaredAnno . getAnnotationClassName ( ) , declaredAnno ) ; if ( overwrittenAnno != null ) { // NO-OP: But maybe we want to log this } } annotations = new ArrayList < AnnotationInfoImpl > ( allAnnotations . values ( ) ) ; return annotations ; }
|
declared + inherited
| 482
| 4
|
163,077
|
private void checkNotClosed ( ) throws SISessionUnavailableException { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkNotClosed" ) ; // Check that the consumer session isn't closed _consumerSession . checkNotClosed ( ) ; // Now check that this consumer hasn't closed. synchronized ( this ) { if ( _closed ) { SISessionUnavailableException e = new SISessionUnavailableException ( nls . getFormattedMessage ( "CONSUMER_CLOSED_ERROR_CWSIP0177" , new Object [ ] { _localConsumerPoint . getConsumerManager ( ) . getDestination ( ) . getName ( ) , _localConsumerPoint . getConsumerManager ( ) . getMessageProcessor ( ) . getMessagingEngineName ( ) } , null ) ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkNotClosed" , "consumer closed" ) ; throw e ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkNotClosed" ) ; }
|
First check is to make sure that the original Consumer hasn t been closed . Then check that this bifurcated consumer session is not closed .
| 246
| 30
|
163,078
|
@ Override public Map < Object , Object > getSwappableData ( ) { if ( mSwappableData == null ) { mSwappableData = new ConcurrentHashMap < Object , Object > ( ) ; if ( isNew ( ) ) { //if this is a new session, then we have the updated app data populatedAppData = true ; } } return mSwappableData ; }
|
This method is copied from DatabaseSession . getSwappableData .
| 86
| 14
|
163,079
|
@ Override public boolean getSwappableListeners ( short requestedListener ) { short thisListenerFlag = getListenerFlag ( ) ; boolean rc = false ; // check session's listenrCnt to see if it has any of the type we want // input listener is either BINDING or ACTIVATION, so if the session has both, its a match if ( thisListenerFlag == requestedListener || thisListenerFlag == HTTP_SESSION_BINDING_AND_ACTIVATION_LISTENER ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "loading data because we have listener match for " + requestedListener ) ; rc = true ; if ( ! populatedAppData ) { try { getSessions ( ) . getIStore ( ) . setThreadContext ( ) ; getMultiRowAppData ( ) ; } finally { getSessions ( ) . getIStore ( ) . unsetThreadContext ( ) ; } } } return rc ; }
|
Copied from DatabaseSession . getSwappableListeners . Get the swappable listeners Called to load session attributes if the session contains Activation or Binding listeners Note we always load ALL attributes here since we can t tell which are listeners until they are loaded .
| 219
| 53
|
163,080
|
public boolean enlistResource ( XAResource xaRes ) throws RollbackException , SystemException , IllegalStateException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "enlistResource" , xaRes ) ; // Determine if we are attempting to enlist a second resource within a transaction // that can't support 2PC anyway. if ( _disableTwoPhase && ( _resourceObjects . size ( ) > 0 ) ) { final String msg = "Unable to enlist a second resource within the transaction. Two phase support is disabled " + "as the recovery log was not available at transaction start" ; final IllegalStateException ise = new IllegalStateException ( msg ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlistResource (SPI)" , ise ) ; throw ise ; } // Create the resource wrapper and see if it already exists in the table OnePhaseResourceImpl jtaRes = new OnePhaseResourceImpl ( ( OnePhaseXAResource ) xaRes , _txServiceXid ) ; boolean register = true ; // See if any other resource has been enlisted // Allow 1PC and 2PC to be enlisted, it will be rejected at prepare time if LPS is not enabled // Reject multiple 1PC enlistments if ( _onePhaseResourceEnlisted != null ) { if ( _onePhaseResourceEnlisted . equals ( jtaRes ) ) { register = false ; jtaRes = _onePhaseResourceEnlisted ; } else { Tr . error ( tc , "WTRN0062_ILLEGAL_ENLIST_FOR_MULTIPLE_1PC_RESOURCES" ) ; final String msg = "Illegal attempt to enlist multiple 1PC XAResources" ; final IllegalStateException ise = new IllegalStateException ( msg ) ; // FFDC in TransactionImpl if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlistResource (SPI)" , ise ) ; throw ise ; } } // // start association of Resource object and register if first time with JTA // and record that a 1PC resource has now been registered with the transaction. // try { this . startRes ( jtaRes ) ; if ( register ) { jtaRes . setResourceStatus ( StatefulResource . REGISTERED ) ; // This is 1PC then we need to insert at element 0 // of the list so we can ensure it is processed last // at completion time. _resourceObjects . add ( 0 , jtaRes ) ; // Check and update LPS enablement state for the application - LIDB1673.22 checkLPSEnablement ( ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "(SPI) RESOURCE registered with Transaction. TX: " + _transaction . getLocalTID ( ) + ", Resource: " + jtaRes ) ; _onePhaseResourceEnlisted = jtaRes ; } } catch ( RollbackException rbe ) { FFDCFilter . processException ( rbe , "com.ibm.tx.jta.impl.RegisteredResources.enlistResource" , "480" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlistResource" , rbe ) ; throw rbe ; } catch ( SystemException se ) { FFDCFilter . processException ( se , "com.ibm.tx.jta.impl.RegisteredResources.enlistResource" , "487" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlistResource" , se ) ; throw se ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlistResource" , Boolean . TRUE ) ; return true ; }
|
Attempts to add a one - Phase XA Resource to this unit of work .
| 818
| 16
|
163,081
|
protected boolean delistResource ( XAResource xaRes , int flag ) throws SystemException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "delistResource" , new Object [ ] { xaRes , Util . printFlag ( flag ) } ) ; // get resource manager instance JTAResourceBase jtaRes = ( JTAResourceBase ) getResourceTable ( ) . get ( xaRes ) ; if ( jtaRes == null && _onePhaseResourceEnlisted != null ) { if ( _onePhaseResourceEnlisted . XAResource ( ) . equals ( xaRes ) ) jtaRes = _onePhaseResourceEnlisted ; } if ( jtaRes == null ) { Tr . error ( tc , "WTRN0065_XARESOURCE_NOT_KNOWN" , xaRes ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "delistResource" , Boolean . FALSE ) ; return false ; } // try to end transaction association using specified flag. try { jtaRes . end ( flag ) ; } catch ( XAException xae ) { _errorCode = xae . errorCode ; // Save locally for FFDC FFDCFilter . processException ( xae , "com.ibm.tx.jta.impl.RegisteredResources.delistResource" , "711" , this ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "XAException: error code " + XAReturnCodeHelper . convertXACode ( _errorCode ) , xae ) ; Throwable toThrow = null ; if ( _errorCode >= XAException . XA_RBBASE && _errorCode <= XAException . XA_RBEND ) { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Transaction branch has been marked rollback-only by the RM" ) ; } else if ( _errorCode == XAException . XAER_RMFAIL ) { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "RM has failed" ) ; // Resource has rolled back jtaRes . setResourceStatus ( StatefulResource . ROLLEDBACK ) ; jtaRes . destroy ( ) ; } else // XAER_RMERR, XAER_INVAL, XAER_PROTO, XAER_NOTA { Tr . error ( tc , "WTRN0079_END_FAILED" , new Object [ ] { XAReturnCodeHelper . convertXACode ( _errorCode ) , xae } ) ; toThrow = new SystemException ( "XAResource end association error:" + XAReturnCodeHelper . convertXACode ( _errorCode ) ) . initCause ( xae ) ; } // Mark transaction as rollback only. try { _transaction . setRollbackOnly ( ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Transaction marked as rollback only." ) ; } catch ( IllegalStateException e ) { FFDCFilter . processException ( e , "com.ibm.tx.jta.impl.RegisteredResources.delistResource" , "742" , this ) ; toThrow = new SystemException ( e . getLocalizedMessage ( ) ) . initCause ( e ) ; } if ( toThrow != null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "delistResource" , toThrow ) ; throw ( SystemException ) toThrow ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "delistResource" , Boolean . TRUE ) ; return true ; }
|
Delist the specified resource from the transaction .
| 813
| 9
|
163,082
|
protected Xid generateNewBranch ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "generateNewBranch" ) ; // Create a new Xid branch final XidImpl result = new XidImpl ( _txServiceXid , ++ _branchCount ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "generateNewBranch" , result ) ; return result ; }
|
Generates a new XidImpl to represent a new branch of this transaction .
| 97
| 16
|
163,083
|
protected void startRes ( JTAResource resource ) throws RollbackException , SystemException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "startRes" , new Object [ ] { this , resource } ) ; try { resource . start ( ) ; } catch ( XAException xae ) { _errorCode = xae . errorCode ; // Save locally for FFDC FFDCFilter . processException ( xae , "com.ibm.tx.jta.impl.RegisteredResources.startRes" , "1053" , this ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "XAException: error code " + XAReturnCodeHelper . convertXACode ( _errorCode ) , xae ) ; final Throwable toThrow ; // // the XAResource object is doing work outside global // transaction. This means that XAResource is doing local // transaction. Local transaction has to be completed before // start global transaction or XA transaction. // if ( _errorCode == XAException . XAER_OUTSIDE ) { toThrow = new RollbackException ( "XAResource working outside transaction" ) . initCause ( xae ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "XAResource is doing work outside of the transaction." , toThrow ) ; throw ( RollbackException ) toThrow ; } else if ( _errorCode >= XAException . XA_RBBASE && _errorCode <= XAException . XA_RBEND ) { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Transaction branch has been marked rollback-only by the RM" ) ; // // Transaction branch has been rolled back, so we // mark transaction as rollback only. // try { _transaction . setRollbackOnly ( ) ; } catch ( IllegalStateException e ) { FFDCFilter . processException ( e , "com.ibm.tx.jta.impl.RegisteredResources.startRes" , "1085" , this ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Exception caught marking Transaction rollback only" , e ) ; throw ( SystemException ) new SystemException ( e . getLocalizedMessage ( ) ) . initCause ( e ) ; } toThrow = new RollbackException ( "Transaction has been marked as rollback only." ) . initCause ( xae ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Marked transaction as rollback only." , toThrow ) ; throw ( RollbackException ) toThrow ; } // // Any other error is a protocol violation or the RM is broken, and we throw // SystemException. // else // XAER_RMERR, XAER_RMFAIL, XAER_INVAL, XAER_PROTO, XAER_DUPID { Tr . error ( tc , "WTRN0078_START_FAILED" , new Object [ ] { XAReturnCodeHelper . convertXACode ( _errorCode ) , xae } ) ; throw ( SystemException ) new SystemException ( "XAResource start association error:" + XAReturnCodeHelper . convertXACode ( _errorCode ) ) . initCause ( xae ) ; } } finally { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "startRes" ) ; } }
|
Starts association of the resource with the current transaction and if required adds a reference to a Resource object to the list in the registered state .
| 760
| 28
|
163,084
|
public int numRegistered ( ) { final int result = _resourceObjects . size ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "numRegistered" , result ) ; return result ; }
|
Returns the number of Resources currently in the list .
| 48
| 10
|
163,085
|
public boolean distributeEnd ( int flags ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "distributeEnd" , Util . printFlag ( flags ) ) ; boolean result = true ; for ( int i = _resourceObjects . size ( ) ; -- i >= 0 ; ) { final JTAResource resource = _resourceObjects . get ( i ) ; if ( ! sendEnd ( resource , flags ) ) { result = false ; } } if ( _sameRMResource != null ) { if ( ! sendEnd ( _sameRMResource , flags ) ) { result = false ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeEnd" , result ) ; return result ; }
|
Send end to all registered resources
| 163
| 6
|
163,086
|
private void updateHeuristicState ( boolean commit ) throws SystemException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "updateHeuristicState" , commit ) ; if ( _transaction . isSubordinate ( ) ) { // Get the current transaction state. Need to do this in case we are // in recovery and have already logged a heuristic final TransactionState ts = _transaction . getTransactionState ( ) ; final int state = ts . getState ( ) ; if ( commit ) { if ( state != TransactionState . STATE_HEURISTIC_ON_COMMIT ) ts . setState ( TransactionState . STATE_HEURISTIC_ON_COMMIT ) ; } else { // if state is ACTIVE, then this is called via // rollbackResources, so do not change state if ( state != TransactionState . STATE_HEURISTIC_ON_ROLLBACK && state != TransactionState . STATE_ACTIVE ) ts . setState ( TransactionState . STATE_HEURISTIC_ON_ROLLBACK ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "updateHeuristicState" ) ; }
|
Possibly update the heuristic state of the transaction . This is only required if this is a subordinate . If we are a subordinate we need to update the state and log it for recovery .
| 253
| 38
|
163,087
|
public boolean distributeForget ( ) throws SystemException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "distributeForget" , this ) ; boolean retryRequired = false ; // indicates whether retry necessary final int resourceCount = _resourceObjects . size ( ) ; // Browse through the participants, processing them as appropriate for ( int i = 0 ; i < resourceCount ; i ++ ) { final JTAResource currResource = _resourceObjects . get ( i ) ; switch ( currResource . getResourceStatus ( ) ) { case StatefulResource . HEURISTIC_COMMIT : case StatefulResource . HEURISTIC_ROLLBACK : case StatefulResource . HEURISTIC_MIXED : case StatefulResource . HEURISTIC_HAZARD : if ( forgetResource ( currResource ) ) { retryRequired = true ; _retryRequired = true ; } break ; default : // do nothing break ; } // end switch } // end for if ( _systemException != null ) { final Throwable toThrow = new SystemException ( ) . initCause ( _systemException ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeForget" , toThrow ) ; throw ( SystemException ) toThrow ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeForget" , retryRequired ) ; return retryRequired ; }
|
Distributes forget messages to all Resources in the appropriate state . Called during retry and mainline .
| 319
| 19
|
163,088
|
public void distributeCommit ( ) throws SystemException , HeuristicHazardException , HeuristicMixedException , HeuristicRollbackException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "distributeCommit" ) ; final TransactionState ts = _transaction . getTransactionState ( ) ; ts . setCommittingStateUnlogged ( ) ; // Shuffle resources around according to commit priority order _retryRequired = sortResources ( ) ; if ( ! _retryRequired ) { _outcome = true ; _retryRequired = distributeOutcome ( ) ; } else { updateHeuristicOutcome ( StatefulResource . HEURISTIC_HAZARD ) ; } if ( _systemException != null ) { final Throwable toThrow = new SystemException ( ) . initCause ( _systemException ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeCommit" , toThrow ) ; throw ( SystemException ) toThrow ; } // check for heuristics ... as we will move forget processing to TransactionImpl later if ( HeuristicOutcome . isHeuristic ( _heuristicOutcome ) ) { switch ( _heuristicOutcome ) { case StatefulResource . HEURISTIC_COMMIT : break ; case StatefulResource . HEURISTIC_ROLLBACK : if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeCommit" , "HeuristicRollbackException" ) ; throw new HeuristicRollbackException ( ) ; case StatefulResource . HEURISTIC_HAZARD : if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeCommit" , "HeuristicHazardException" ) ; throw new HeuristicHazardException ( ) ; default : if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeCommit" , "HeuristicMixedException" ) ; throw new HeuristicMixedException ( ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeCommit" ) ; }
|
Distributes commit messages to all Resources in the registered state .
| 458
| 12
|
163,089
|
public void destroyResources ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "destroyResources" ) ; // Browse through the participants, processing them as appropriate final ArrayList < JTAResource > resources = getResourceObjects ( ) ; for ( JTAResource resource : resources ) { destroyResource ( resource ) ; } if ( _sameRMResource != null ) { destroyResource ( _sameRMResource ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "destroyResources" ) ; }
|
Cleanup resources that have not yet been completed . A utility function called when transaction completion has been abandonned either when retries have been exhausted or the operator has cancelled the transaction .
| 120
| 36
|
163,090
|
@ Override public int compare ( JTAResource o1 , JTAResource o2 ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "compare" , new Object [ ] { o1 , o2 , this } ) ; int result = 0 ; int p1 = o1 . getPriority ( ) ; int p2 = o2 . getPriority ( ) ; if ( p1 < p2 ) result = 1 ; else if ( p1 > p2 ) result = - 1 ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "compare" , result ) ; return result ; }
|
Comparator returning 0 should leave elements in list alone preserving original order .
| 145
| 14
|
163,091
|
protected boolean sortResources ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "sortResources" , _resourceObjects . toArray ( ) ) ; if ( ! _sorted ) { final int resourceCount = _resourceObjects . size ( ) ; if ( _gotPriorityResourcesEnlisted ) { if ( resourceCount > 1 ) Collections . sort ( _resourceObjects , this ) ; } _sorted = true ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "sortResources" , _resourceObjects . toArray ( ) ) ; return false ; }
|
Shuffle commitInLastPhase resources to the end of the list preserving their ordering or reorder resources based on commitPriority in descending order for commit phase .
| 135
| 32
|
163,092
|
protected void sortPreparePriorityResources ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "sortPreparePriorityResources" , _resourceObjects . toArray ( ) ) ; Collections . sort ( _resourceObjects , prepareComparator ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "sortPreparePriorityResources" , _resourceObjects . toArray ( ) ) ; return ; }
|
Reorder resources based on commitPriority in asccending order for prepare phase .
| 100
| 17
|
163,093
|
public boolean isLastAgentEnlisted ( ) { final boolean lastAgentEnlisted = ( _onePhaseResourceEnlisted != null ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "isLastAgentEnlisted" , lastAgentEnlisted ) ; return lastAgentEnlisted ; }
|
Informs the caller if a 1PC resource is enlisted in this unit of work .
| 65
| 17
|
163,094
|
public Map < String , String > getDurableSelectorNamespaceMap ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getDurableSelectorNamespaceMap" ) ; Map < String , String > map = null ; if ( jmo . getChoiceField ( ControlAccess . BODY_CREATEDURABLE_NAMESPACEMAP ) == ControlAccess . IS_BODY_CREATEDURABLE_NAMESPACEMAP_MAP ) { List < String > names = ( List < String > ) jmo . getField ( ControlAccess . BODY_CREATEDURABLE_NAMESPACEMAP_MAP_NAME ) ; List < Object > values = ( List < Object > ) jmo . getField ( ControlAccess . BODY_CREATEDURABLE_NAMESPACEMAP_MAP_VALUE ) ; map = ( Map < String , String > ) ( Map < String , ? > ) new JsMsgMap ( names , values ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getDurableSelectorNamespaceMap" , map ) ; return map ; }
|
Get the map of prefixes to namespace URLs that are associated with the selector .
| 279
| 16
|
163,095
|
public void setDurableSelectorNamespaceMap ( Map < String , String > namespaceMap ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setDurableSelectorNamespaceMap" , namespaceMap ) ; if ( namespaceMap == null ) { jmo . setChoiceField ( ControlAccess . BODY_CREATEDURABLE_NAMESPACEMAP , ControlAccess . IS_BODY_CREATEDURABLE_NAMESPACEMAP_UNSET ) ; } else { List < String > names = new ArrayList < String > ( ) ; List < String > values = new ArrayList < String > ( ) ; Set < Map . Entry < String , String > > es = namespaceMap . entrySet ( ) ; for ( Map . Entry < String , String > entry : es ) { names . add ( entry . getKey ( ) ) ; values . add ( entry . getValue ( ) ) ; } jmo . setField ( ControlAccess . BODY_CREATEDURABLE_NAMESPACEMAP_MAP_NAME , names ) ; jmo . setField ( ControlAccess . BODY_CREATEDURABLE_NAMESPACEMAP_MAP_VALUE , values ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setDurableSelectorNamespaceMap" ) ; }
|
Sets a map of prefixes to namespace URLs that are associated with the selector .
| 321
| 17
|
163,096
|
public void close ( ) throws IOException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "close" , new Object [ ] { this , _file } ) ; // By locking on the class rather than the object, and removing // the inner lock on the class, this seems to resolve the problems // reported in d347231 that file handles were not being released properly // synchronized(this) synchronized ( RLSAccessFile . class ) { _useCount -- ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "remaining file use count" , new Integer ( _useCount ) ) ; // Check for 0 usage and close the actual file. // One needs to be aware that close() can be called both directly by the user on // file.close(), and also indirectly by the JVM. The JVM will call close() on a // filechannel.close() and also recursively call filechanel.close() and hence close() // on a file.close(). For this reason, filechannel.close() has been removed from // LogFileHandle calls - but it is still in CoordinationLock just in case the behaviour // of the JVM changes wrt lock releases. This behaviour can make interesting trace // reading because one can get the use count dropping to -1 either because of two // serial calls (filechannel.close() + file.close()) or two recursive calls (ie // file.close() calling filechannel.close() calling file.close()). // Trace an innocious exception to help debug any recursion problems. if ( tc . isDebugEnabled ( ) && ( _useCount <= 0 ) ) { Tr . debug ( tc , "call stack" , new Exception ( "Dummy traceback" ) ) ; } if ( _useCount == 0 ) { super . close ( ) ; // Outer lock is now on class, so no need to lock here (d347231) // synchronized(RLSAccessFile.class) // { _accessFiles . remove ( _file ) ; // } } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "close" ) ; }
|
The logic in close needs to account for recursive calls . See notes below .
| 457
| 15
|
163,097
|
public int getInteger ( String key ) throws MissingResourceException { String result = getString ( key ) ; try { return Integer . parseInt ( result ) ; } catch ( NumberFormatException nfe ) { if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "Unable to parse " + result + " as Integer." ) ; } // DGH20040823: Begin fix for defect 218797 - Source provided by Tom Musta // String msg = messages.getString("NLS.integerParseError", // "Unable to parse as integer."); String msg = getMessages ( ) . getString ( "NLS.integerParseError" , "Unable to parse as integer." ) ; // DGH20040823: End fix for defect 218797 - Source provided by Tom Musta throw new MissingResourceException ( msg , bundleName , key ) ; } }
|
Not sure why this is here . Looks like it is a replacement for Integer . getInteger .
| 191
| 19
|
163,098
|
public void stop ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "stop" ) ; // Lock exclusively for start operations mpioLockManager . lockExclusive ( ) ; started = false ; mpioLockManager . unlockExclusive ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "stop" ) ; }
|
Method to stop MPIO from processing any new messages . This will take an exclusive lock on the lock manager and change the started flag to false .
| 107
| 29
|
163,099
|
public void receiveMessage ( MEConnection conn , AbstractMessage aMessage ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "receiveMessage" , new Object [ ] { conn , aMessage , "verboseMsg IN : " + aMessage . toVerboseString ( ) } ) ; // Minimal comms trace of the message we've received if ( TraceComponent . isAnyTracingEnabled ( ) ) { MECommsTrc . traceMessage ( tc , _messageProcessor , aMessage . getGuaranteedSourceMessagingEngineUUID ( ) , MECommsTrc . OP_RECV , conn , aMessage ) ; } // Take a read lock to ensure that we can't be stopped while processing a // message mpioLockManager . lock ( ) ; try { if ( started ) { //pass the message on to the RMR _remoteMessageReciever . receiveMessage ( aMessage ) ; } else if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "Ignoring message as in stopped state" ) ; } } catch ( Throwable e ) { // Anything going wrong in Processor (or below, e.g. MsgStore) shouldn't // bring the ME-ME connection down. To get an exception through to here // we must have gone wrong somewhere, i.e. an APAR-kind of event. But even // so, that's no reason to knobble all ME-to-ME communication, so we swallow // any exception here, after spitting out an FFDC. FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.io.MPIO.receiveMessage" , "1:228:1.32" , new Object [ ] { this , aMessage , conn , _messageProcessor . getMessagingEngineName ( ) } ) ; if ( e instanceof Exception ) SibTr . exception ( tc , ( Exception ) e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Exception occurred when processing a message " + e ) ; // We're not allowed to swallow this exception - let it work its way back to // Comms if ( e instanceof ThreadDeath ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "receiveMessage" , e ) ; throw ( ThreadDeath ) e ; } } finally { mpioLockManager . unlock ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "receiveMessage" ) ; }
|
Receive a new Control message from an ME - ME connection .
| 617
| 13
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.