idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
163,400
private boolean checkIfUpgradeHeaders ( Map < String , String > headers ) { 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 ( ) ; 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 ) { 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 ) { 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
163,401
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 ) { return ZipLicenseProvider . getInstance ( ) ; } } if ( subsystemLicenseType != null && subsystemLicenseType . length ( ) > 0 ) { return new ThirdPartyLicenseProvider ( featureDefinition . getFeatureName ( ) , subsystemLicenseType ) ; } return null ; }
will need to override
163,402
public LocalTransaction createLocalTransaction ( boolean useSingleResourceOnly ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createLocalTransaction" ) ; LocalTransaction tran = null ; tran = transactionFactory . createLocalTransaction ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createLocalTransaction" , tran ) ; return tran ; }
Creates a local transaction .
163,403
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
163,404
public SIXAResource createXAResource ( boolean useSingleResource ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createXAResource" , new Boolean ( useSingleResource ) ) ; SIXAResource resource = null ; resource = transactionFactory . createXAResource ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createXAResource" , resource ) ; return resource ; }
Creates an XA transaction resource
163,405
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 ) { Tr . error ( tc , "DYNA1004E" , new Object [ ] { reference } ) ; } DistributedObjectCache dCache = null ; synchronized ( config ) { 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 .
163,406
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 .
163,407
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
163,408
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 .
163,409
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 .
163,410
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 .
163,411
@ 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 .
163,412
synchronized public Map < String , Serializable > generateDDL ( ) { Map < String , Serializable > returnMap = new HashMap < String , Serializable > ( ) ; WsResource ddlOutputDirectory = locationService . get ( ) . resolveResource ( OUTPUT_DIR ) ; if ( ddlOutputDirectory . exists ( ) == false ) { ddlOutputDirectory . create ( ) ; } try { returnMap . put ( OUTPUT_DIRECTORY , ddlOutputDirectory . asFile ( ) . getCanonicalPath ( ) ) ; } catch ( IOException ioe ) { returnMap . put ( OUTPUT_DIRECTORY , OUTPUT_DIR ) ; } boolean success = true ; int fileCount = 0 ; Map < String , DDLGenerationParticipant > participants = new HashMap < String , DDLGenerationParticipant > ( ) ; Iterator < ServiceAndServiceReferencePair < DDLGenerationParticipant > > i = generators . getServicesWithReferences ( ) ; while ( i . hasNext ( ) ) { ServiceAndServiceReferencePair < DDLGenerationParticipant > generatorPair = i . next ( ) ; DDLGenerationParticipant generator = generatorPair . getService ( ) ; String rawId = generator . getDDLFileName ( ) ; String id = ( rawId != null ) ? PathUtils . replaceRestrictedCharactersInFileName ( rawId ) : null ; if ( ( id == null ) || ( id . length ( ) == 0 ) ) { throw new IllegalArgumentException ( "Service " + generator . toString ( ) + " DDL file name: " + rawId ) ; } participants . put ( id , generator ) ; } for ( Map . Entry < String , DDLGenerationParticipant > entry : participants . entrySet ( ) ) { String id = entry . getKey ( ) ; DDLGenerationParticipant participant = entry . getValue ( ) ; WsResource ddlOutputResource = locationService . get ( ) . resolveResource ( OUTPUT_DIR + id + ".ddl" ) ; if ( ddlOutputResource . exists ( ) == false ) { ddlOutputResource . create ( ) ; } try { TextFileOutputStreamFactory f = TrConfigurator . getFileOutputStreamFactory ( ) ; OutputStream os = f . createOutputStream ( ddlOutputResource . asFile ( ) , false ) ; BufferedWriter bw = new BufferedWriter ( new OutputStreamWriter ( os , "UTF-8" ) ) ; participant . generate ( bw ) ; bw . close ( ) ; fileCount ++ ; } catch ( Throwable t ) { success = false ; } } returnMap . put ( SUCCESS , Boolean . valueOf ( success ) ) ; returnMap . put ( FILE_COUNT , Integer . valueOf ( fileCount ) ) ; return returnMap ; }
Trigger DDL generation for anyone who needs to generate DDL .
163,413
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
163,414
public void applyAttachedObject ( FacesContext context , UIComponent parent ) { 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 ) { ClientBehaviorHolder cvh = ( ClientBehaviorHolder ) parent ; 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
163,415
@ FFDCIgnore ( InvocationTargetException . class ) Object getDB ( String databaseName ) throws Exception { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; lock . readLock ( ) . lock ( ) ; try { if ( mongoClient == null ) { lock . readLock ( ) . unlock ( ) ; lock . writeLock ( ) . lock ( ) ; try { if ( mongoClient == null ) init ( ) ; } finally { lock . readLock ( ) . lock ( ) ; lock . writeLock ( ) . unlock ( ) ; } } Object db = MongoClient_getDB . invoke ( mongoClient , databaseName ) ; 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 ) { 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 ) { } return db ; } catch ( Throwable x ) { 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 .
163,416
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 ) ) ; } 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
163,417
@ FFDCIgnore ( Throwable . class ) 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 ) ; Method method = MongoClientOptions_Builder . getMethod ( propName , type ) ; 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 .
163,418
@ FFDCIgnore ( Throwable . class ) 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" ) ; Object readPreference = ReadPreference . getMethod ( creatorMethod ) . invoke ( ReadPreference ) ; 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 .
163,419
@ FFDCIgnore ( Throwable . class ) 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" ) ; 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 .
163,420
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
163,421
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
163,422
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 ( ) ) { 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 ) { if ( sslHelper == null ) { throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0015.ssl.feature.missing" , MONGO , id ) ) ; } if ( useCertAuth ) { if ( ! sslEnabled ) { throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0019.ssl.certificate.no.ssl" , MONGO , id ) ) ; } if ( props . get ( USER ) != null || props . get ( PASSWORD ) != null ) { 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 .
163,423
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 .
163,424
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 .
163,425
public void setReferrerURLCookie ( HttpServletRequest req , AuthenticationResult authResult , String url ) { 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 .
163,426
@ 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 ) { 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 .
163,427
public void bytes ( Object source , Class sourceClass , byte [ ] data ) { internalBytes ( source , sourceClass , data , 0 , 0 ) ; }
Byte data trace .
163,428
public final void entry ( Class sourceClass , String methodName ) { internalEntry ( null , sourceClass , methodName , null ) ; }
Method entry tracing for static classes .
163,429
public final void exit ( Class sourceClass , String methodName ) { internalExit ( null , sourceClass , methodName , null ) ; }
Method exit tracing for static methods .
163,430
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 .
163,431
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 .
163,432
public final void event ( Object source , Class sourceClass , String methodName , Throwable throwable ) { internalEvent ( source , sourceClass , methodName , throwable ) ; }
Event tracing .
163,433
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 .
163,434
public final void info ( Class sourceClass , String methodName , String messageIdentifier , Object object ) { internalInfo ( null , sourceClass , methodName , messageIdentifier , object ) ; }
Method information tracing for static objects .
163,435
public final void warning ( Class sourceClass , String methodName , String messageIdentifier , Object object ) { internalWarning ( null , sourceClass , methodName , messageIdentifier , object ) ; }
Method warning tracing for static objects .
163,436
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
163,437
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 .
163,438
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
163,439
void restoreDynacacheProviderDefaults ( ) { 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 .
163,440
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
163,441
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
163,442
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
163,443
protected void loadCipherToBit ( ) { boolean keySizeFromCipherMap = Boolean . valueOf ( WebContainer . getWebContainerProperties ( ) . getProperty ( "com.ibm.ws.webcontainer.keysizefromciphermap" , "true" ) ) . booleanValue ( ) ; if ( keySizeFromCipherMap ) { this . getKeySizefromCipherMap ( "toLoad" ) ; } else { Properties cipherToBitProps = new Properties ( ) ; 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 ) ; com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( ex , CLASS_NAME + ".loadCipherToBit" , "825" , this ) ; } _cipherToBit . putAll ( cipherToBitProps ) ; } }
112102 - added method below to fill the cipher to bit size table
163,444
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 .
163,445
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
163,446
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
163,447
protected static void sendUnavailableException ( IRequest req , IResponse res ) throws IOException { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "sendUnavailableException" , "Inside sendUnavailableException" ) ; res . addHeader ( "Content-Type" , "text/html" ) ; res . setStatusCode ( 503 ) ; 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
163,448
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
163,449
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
163,450
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
163,451
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
163,452
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
163,453
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
163,454
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,455
@ Mode ( TestMode . LITE ) 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
163,456
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 .
163,457
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 .
163,458
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
163,459
public static void initialise ( AcceptListenerFactory _acceptListenerFactory ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "initalise" ) ; acceptListenerFactory = _acceptListenerFactory ; Framework framework = Framework . getInstance ( ) ; if ( framework == null ) { state = State . INITIALISATION_FAILED ; } else { state = State . INITIALISED ; connectionTracker = new OutboundConnectionTracker ( framework ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "initalise" ) ; }
Initialises the server connection manager by getting hold of the framework .
163,460
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 .
163,461
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 .
163,462
public void open ( ) throws InfoStoreException { String methodName = "open" ; try { getClassSource ( ) . open ( ) ; } catch ( ClassSource_Exception e ) { 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 .
163,463
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 ) ; if ( logParms != null ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Class [ {1} ] RETURN New load" , logParms ) ) ; } }
Visitor helpers ...
163,464
public PackageInfoImpl getPackageInfo ( String name ) { return getClassInfoCache ( ) . getPackageInfo ( name , ClassInfoCache . DO_NOT_FORCE_PACKAGE ) ; }
a package info even if an error occurrs .
163,465
private void updateBindings ( Map < String , Object > props ) { processProps ( props , CFG_KEY_USER , users ) ; processProps ( props , CFG_KEY_USER_ACCESSID , users ) ; processProps ( props , CFG_KEY_GROUP , groups ) ; processProps ( props , CFG_KEY_GROUP_ACCESSID , groups ) ; }
Update the binding sets based on the properties from the configuration .
163,466
public void cancel ( Exception reason ) { if ( this . channel == null ) { return ; } synchronized ( this . completedSemaphore ) { if ( ! this . completed ) { try { this . channel . cancel ( this , reason ) ; } catch ( Exception e ) { } } 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 .
163,467
protected void fireCompletionActions ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "fireCompletionActions" ) ; } if ( this . firstListener != null ) { ICompletionListener listenerToInvoke = this . firstListener ; 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
163,468
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 .
163,469
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 .
163,470
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
163,471
public List < AnnotationInfoImpl > getAnnotations ( ) { if ( annotations != null ) { return annotations ; } ClassInfoImpl useSuperClass = getSuperclass ( ) ; if ( useSuperClass == null ) { annotations = declaredAnnotations ; return annotations ; } 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 ; } for ( AnnotationInfoImpl declaredAnno : declaredAnnotations ) { AnnotationInfoImpl overwrittenAnno = allAnnotations . put ( declaredAnno . getAnnotationClassName ( ) , declaredAnno ) ; if ( overwrittenAnno != null ) { } } annotations = new ArrayList < AnnotationInfoImpl > ( allAnnotations . values ( ) ) ; return annotations ; }
declared + inherited
163,472
private void checkNotClosed ( ) throws SISessionUnavailableException { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkNotClosed" ) ; _consumerSession . checkNotClosed ( ) ; 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 .
163,473
public Map < Object , Object > getSwappableData ( ) { if ( mSwappableData == null ) { mSwappableData = new ConcurrentHashMap < Object , Object > ( ) ; if ( isNew ( ) ) { populatedAppData = true ; } } return mSwappableData ; }
This method is copied from DatabaseSession . getSwappableData .
163,474
public boolean getSwappableListeners ( short requestedListener ) { short thisListenerFlag = getListenerFlag ( ) ; boolean rc = false ; 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 .
163,475
public boolean enlistResource ( XAResource xaRes ) throws RollbackException , SystemException , IllegalStateException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "enlistResource" , xaRes ) ; 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 ; } OnePhaseResourceImpl jtaRes = new OnePhaseResourceImpl ( ( OnePhaseXAResource ) xaRes , _txServiceXid ) ; boolean register = true ; 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 ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlistResource (SPI)" , ise ) ; throw ise ; } } try { this . startRes ( jtaRes ) ; if ( register ) { jtaRes . setResourceStatus ( StatefulResource . REGISTERED ) ; _resourceObjects . add ( 0 , jtaRes ) ; 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 .
163,476
protected boolean delistResource ( XAResource xaRes , int flag ) throws SystemException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "delistResource" , new Object [ ] { xaRes , Util . printFlag ( flag ) } ) ; 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 { jtaRes . end ( flag ) ; } catch ( XAException xae ) { _errorCode = xae . errorCode ; 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" ) ; jtaRes . setResourceStatus ( StatefulResource . ROLLEDBACK ) ; jtaRes . destroy ( ) ; } else { Tr . error ( tc , "WTRN0079_END_FAILED" , new Object [ ] { XAReturnCodeHelper . convertXACode ( _errorCode ) , xae } ) ; toThrow = new SystemException ( "XAResource end association error:" + XAReturnCodeHelper . convertXACode ( _errorCode ) ) . initCause ( xae ) ; } 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 .
163,477
protected Xid generateNewBranch ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "generateNewBranch" ) ; 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 .
163,478
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 ; 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 ; 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" ) ; 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 ; } else { 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 .
163,479
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 .
163,480
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,481
private void updateHeuristicState ( boolean commit ) throws SystemException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "updateHeuristicState" , commit ) ; if ( _transaction . isSubordinate ( ) ) { 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 != 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 .
163,482
public boolean distributeForget ( ) throws SystemException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "distributeForget" , this ) ; boolean retryRequired = false ; final int resourceCount = _resourceObjects . size ( ) ; 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 : break ; } } 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 .
163,483
protected boolean forgetResource ( JTAResource resource ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "forgetResource" , resource ) ; boolean result = false ; boolean auditing = false ; try { boolean informResource = true ; auditing = _transaction . auditSendForget ( resource ) ; if ( xaFlowCallbackEnabled ) { informResource = XAFlowCallbackControl . beforeXAFlow ( XAFlowCallback . FORGET , XAFlowCallback . FORGET_NORMAL ) ; } if ( informResource ) { resource . forget ( ) ; } resource . setResourceStatus ( StatefulResource . COMPLETED ) ; if ( auditing ) _transaction . auditForgetResponse ( XAResource . XA_OK , resource ) ; if ( xaFlowCallbackEnabled ) { XAFlowCallbackControl . afterXAFlow ( XAFlowCallback . FORGET , XAFlowCallback . AFTER_SUCCESS ) ; } } catch ( XAException xae ) { _errorCode = xae . errorCode ; FFDCFilter . processException ( xae , "com.ibm.tx.jta.impl.RegisteredResources.forgetResource" , "2859" , this ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "XAException: error code " + XAReturnCodeHelper . convertXACode ( _errorCode ) , xae ) ; if ( auditing ) _transaction . auditForgetResponse ( _errorCode , resource ) ; if ( xaFlowCallbackEnabled ) { XAFlowCallbackControl . afterXAFlow ( XAFlowCallback . FORGET , XAFlowCallback . AFTER_FAIL ) ; } if ( _errorCode == XAException . XAER_RMERR ) { result = true ; addToFailedResources ( resource ) ; } else if ( _errorCode == XAException . XAER_RMFAIL ) { resource . setState ( JTAResource . FAILED ) ; result = true ; addToFailedResources ( resource ) ; } else if ( _errorCode == XAException . XAER_NOTA ) { resource . setResourceStatus ( StatefulResource . COMPLETED ) ; resource . destroy ( ) ; } else { if ( ! auditing ) Tr . error ( tc , "WTRN0054_XA_FORGET_ERROR" , new Object [ ] { XAReturnCodeHelper . convertXACode ( _errorCode ) , xae } ) ; resource . setResourceStatus ( StatefulResource . COMPLETED ) ; _systemException = xae ; } } catch ( Throwable t ) { FFDCFilter . processException ( t , "com.ibm.tx.jta.impl.RegisteredResources.forgetResource" , "2935" , this ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "RuntimeException" , t ) ; if ( xaFlowCallbackEnabled ) { XAFlowCallbackControl . afterXAFlow ( XAFlowCallback . FORGET , XAFlowCallback . AFTER_FAIL ) ; } result = true ; addToFailedResources ( resource ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "forgetResource" , result ) ; return result ; }
Distribute forget flow to given resource . Used internally when resource indicates a heuristic condition . May result in retries if resource cannot be contacted .
163,484
public void distributeCommit ( ) throws SystemException , HeuristicHazardException , HeuristicMixedException , HeuristicRollbackException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "distributeCommit" ) ; final TransactionState ts = _transaction . getTransactionState ( ) ; ts . setCommittingStateUnlogged ( ) ; _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 ; } 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 .
163,485
public void destroyResources ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "destroyResources" ) ; 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 .
163,486
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 .
163,487
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 .
163,488
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 .
163,489
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 .
163,490
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 .
163,491
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 .
163,492
public void close ( ) throws IOException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "close" , new Object [ ] { this , _file } ) ; synchronized ( RLSAccessFile . class ) { _useCount -- ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "remaining file use count" , new Integer ( _useCount ) ) ; if ( tc . isDebugEnabled ( ) && ( _useCount <= 0 ) ) { Tr . debug ( tc , "call stack" , new Exception ( "Dummy traceback" ) ) ; } if ( _useCount == 0 ) { super . close ( ) ; _accessFiles . remove ( _file ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "close" ) ; }
The logic in close needs to account for recursive calls . See notes below .
163,493
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." ) ; } String msg = getMessages ( ) . getString ( "NLS.integerParseError" , "Unable to parse as integer." ) ; throw new MissingResourceException ( msg , bundleName , key ) ; } }
Not sure why this is here . Looks like it is a replacement for Integer . getInteger .
163,494
public void stop ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "stop" ) ; 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 .
163,495
public void receiveMessage ( MEConnection conn , AbstractMessage aMessage ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "receiveMessage" , new Object [ ] { conn , aMessage , "verboseMsg IN : " + aMessage . toVerboseString ( ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) ) { MECommsTrc . traceMessage ( tc , _messageProcessor , aMessage . getGuaranteedSourceMessagingEngineUUID ( ) , MECommsTrc . OP_RECV , conn , aMessage ) ; } mpioLockManager . lock ( ) ; try { if ( started ) { _remoteMessageReciever . receiveMessage ( aMessage ) ; } else if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "Ignoring message as in stopped state" ) ; } } catch ( Throwable e ) { 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 ) ; 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 .
163,496
public MPConnection getOrCreateNewMPConnection ( SIBUuid8 remoteUuid , MEConnection conn ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getOrCreateNewMPConnection" , new Object [ ] { remoteUuid , conn } ) ; MPConnection mpConn ; synchronized ( _mpConnectionsByMEConnection ) { mpConn = _mpConnectionsByMEConnection . get ( conn ) ; if ( mpConn == null ) { if ( remoteUuid == null ) { remoteUuid = new SIBUuid8 ( conn . getMessagingEngine ( ) . getUuid ( ) ) ; } mpConn = new MPConnection ( this , conn , remoteUuid ) ; _mpConnectionsByMEConnection . put ( conn , mpConn ) ; _mpConnectionsByMEUuid . put ( remoteUuid , mpConn ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getOrCreateNewMPConnection" , mpConn ) ; return mpConn ; }
Get a MPConnection from the cache and if there isn t one create a new one and put it in the cache .
163,497
public MPConnection removeConnection ( MEConnection conn ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeConnection" , new Object [ ] { conn } ) ; MPConnection mpConn ; synchronized ( _mpConnectionsByMEConnection ) { mpConn = _mpConnectionsByMEConnection . remove ( conn ) ; if ( mpConn != null ) { _mpConnectionsByMEUuid . remove ( mpConn . getRemoteMEUuid ( ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeConnection" , mpConn ) ; return mpConn ; }
remove a MPConnection from the cache
163,498
public void error ( MEConnection conn , Throwable ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "error" , new Object [ ] { this , conn , ex } ) ; _commsErrorListener . error ( conn , ex ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "error" ) ; }
Indicates an error has occurred on a connection .
163,499
public void changeConnection ( MEConnection downConn , MEConnection upConn ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "changeConnection" , new Object [ ] { this , downConn , upConn } ) ; if ( downConn != null ) { removeConnection ( downConn ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "changeConnection" ) ; }
Indiciates a failed connection a newly created connection or a connection swap . If upConn is null then connection downConn has been removed from the system . If downConn is null then connection upConn has been added to the system . Otherwise downConn has been removed and replaced by upConn .