idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
39,100
protected void updateTranLogServiceData ( ) throws Exception { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "updateTranLogServiceData" ) ; try { if ( _tranlogServiceData == null ) { _tranlogServiceData = _tranLog . createRecoverableUnit ( ) ; _tranlogServerSection = _tranlogServiceData . createSection ( TransactionImpl . SERVER_DATA_SECTION , true ) ; _tranlogApplIdSection = _tranlogServiceData . createSection ( TransactionImpl . APPLID_DATA_SECTION , true ) ; _tranlogEpochSection = _tranlogServiceData . createSection ( TransactionImpl . EPOCH_DATA_SECTION , true ) ; _tranlogServerSection . addData ( Utils . byteArray ( _failureScopeController . serverName ( ) ) ) ; _tranlogApplIdSection . addData ( _ourApplId ) ; } _tranlogEpochSection . addData ( Util . intToBytes ( _ourEpoch ) ) ; _tranlogServiceData . forceSections ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.tx.jta.impl.RecoveryManager.updateTranLogSeviceData" , "1130" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "updateTranLogServiceData" , e ) ; throw e ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "updateTranLogServiceData" ) ; }
Update service data in the tran log files
39,101
protected void updatePartnerServiceData ( ) throws Exception { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "updatePartnerServiceData" ) ; try { if ( _partnerServiceData == null ) { if ( _recoverXaLog != null ) _partnerServiceData = _recoverXaLog . createRecoverableUnit ( ) ; else _partnerServiceData = _xaLog . createRecoverableUnit ( ) ; _partnerServerSection = _partnerServiceData . createSection ( TransactionImpl . SERVER_DATA_SECTION , true ) ; _partnerApplIdSection = _partnerServiceData . createSection ( TransactionImpl . APPLID_DATA_SECTION , true ) ; _partnerEpochSection = _partnerServiceData . createSection ( TransactionImpl . EPOCH_DATA_SECTION , true ) ; _partnerLowWatermarkSection = _partnerServiceData . createSection ( TransactionImpl . LOW_WATERMARK_SECTION , true ) ; _partnerNextIdSection = _partnerServiceData . createSection ( TransactionImpl . NEXT_ID_SECTION , true ) ; _partnerServerSection . addData ( Utils . byteArray ( _failureScopeController . serverName ( ) ) ) ; _partnerApplIdSection . addData ( _ourApplId ) ; _partnerEntryLowWatermark = 1 ; _partnerLowWatermarkSection . addData ( Util . intToBytes ( _partnerEntryLowWatermark ) ) ; _partnerEntryNextId = 2 ; _partnerNextIdSection . addData ( Util . intToBytes ( _partnerEntryNextId ) ) ; } _partnerEpochSection . addData ( Util . intToBytes ( _ourEpoch ) ) ; updateServerState ( STARTING ) ; _partnerServiceData . forceSections ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.tx.jta.impl.RecoveryManager.updatePartnerSeviceData" , "1224" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "updatePartnerServiceData" , e ) ; throw e ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "updatePartnerServiceData" ) ; }
Update service data in the partner log files
39,102
public void waitForRecoveryCompletion ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "waitForRecoveryCompletion" ) ; if ( ! _recoveryCompleted ) { try { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "starting to wait for recovery completion" ) ; _recoveryInProgress . waitEvent ( ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "completed wait for recovery completion" ) ; } catch ( InterruptedException exc ) { FFDCFilter . processException ( exc , "com.ibm.tx.jta.impl.RecoveryManager.waitForRecoveryCompletion" , "1242" , this ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Wait for recovery complete interrupted." ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "waitForRecoveryCompletion" ) ; }
Blocks the current thread until initial recovery has completed .
39,103
public void recoveryComplete ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "recoveryComplete" ) ; if ( ! _recoveryCompleted ) { _recoveryCompleted = true ; _recoveryInProgress . post ( ) ; } if ( _agent != null ) { try { RecoveryDirectorFactory . recoveryDirector ( ) . initialRecoveryComplete ( _agent , _failureScopeController . failureScope ( ) ) ; } catch ( Exception exc ) { FFDCFilter . processException ( exc , "com.ibm.tx.jta.impl.RecoveryManager.recoveryComplete" , "1546" , this ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "recoveryComplete" ) ; }
Marks recovery as completed and signals the recovery director to this effect .
39,104
public boolean shutdownInProgress ( ) { synchronized ( _recoveryMonitor ) { if ( _shutdownInProgress ) { if ( ! _recoveryCompleted ) { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Shutdown is in progress, stopping recovery processing" ) ; recoveryComplete ( ) ; if ( _failureScopeController . localFailureScope ( ) ) { TMHelper . asynchRecoveryProcessingComplete ( null ) ; } } } } return _shutdownInProgress ; }
examine the boolean return value and not proceed with recovery if its true .
39,105
protected TransactionImpl [ ] getRecoveringTransactions ( ) { TransactionImpl [ ] recoveredTransactions = new TransactionImpl [ _recoveringTransactions . size ( ) ] ; _recoveringTransactions . toArray ( recoveredTransactions ) ; return recoveredTransactions ; }
This method should only be called from the recover thread else ConcurretModificationException may arise
39,106
protected void closeLogs ( boolean closeLeaseLog ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "closeLogs" , new Object [ ] { this , closeLeaseLog } ) ; if ( ( _tranLog != null ) && ( _tranLog instanceof DistributedRecoveryLog ) ) { try { ( ( DistributedRecoveryLog ) _tranLog ) . closeLogImmediate ( ) ; } catch ( Exception e ) { } _tranLog = null ; } if ( ( _xaLog != null ) && ( _xaLog instanceof DistributedRecoveryLog ) ) { try { ( ( DistributedRecoveryLog ) _xaLog ) . closeLogImmediate ( ) ; } catch ( Exception e ) { } _xaLog = null ; } try { if ( _leaseLog != null && closeLeaseLog ) { _leaseLog . deleteServerLease ( _failureScopeController . serverName ( ) ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "closeLogs" ) ; }
Close the loggs without any keypoint - to be called on a failure to leave the logs alone and ensure distributed shutdown code does not update them .
39,107
public void registerTransaction ( TransactionImpl tran ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerTransaction" , new Object [ ] { this , tran } ) ; _recoveringTransactions . add ( tran ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerTransaction" , _recoveringTransactions . size ( ) ) ; }
Registers a recovered transactions existance . This method is triggered from the FailureScopeController . registerTransaction for all transactions that have been created during a recovery process .
39,108
public void deregisterTransaction ( TransactionImpl tran ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "deregisterTransaction" , new Object [ ] { this , tran } ) ; _recoveringTransactions . remove ( tran ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "deregisterTransaction" , _recoveringTransactions . size ( ) ) ; }
Deregisters a recovered transactions existance . This method is triggered from the FailureScopeController . deregisterTransaction for recovered transactions .
39,109
protected boolean recoveryModeTxnsComplete ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "recoveryModeTxnsComplete" ) ; if ( _recoveringTransactions != null ) { for ( TransactionImpl tx : _recoveringTransactions ) { if ( tx != null && ! tx . isRAImport ( ) ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "recoveryModeTxnsComplete" , Boolean . FALSE ) ; return false ; } } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "recoveryModeTxnsComplete" , Boolean . TRUE ) ; return true ; }
This does not include JCA inbound txns
39,110
protected void run ( String war , String servlet , String testMethod ) throws Exception { FATServletClient . runTest ( getServer ( ) , war + "/" + servlet , testMethod ) ; }
Run a test by connecting to a url that is put together with the context - root being the war the servlet and test method in the web application .
39,111
private Context getURLContext ( String name ) throws NamingException { int schemeIndex = name . indexOf ( ":" ) ; if ( schemeIndex != - 1 ) { String scheme = name . substring ( 0 , schemeIndex ) ; return NamingManager . getURLContext ( scheme , env ) ; } return null ; }
Get the URL context given a name based on the scheme of the URL .
39,112
private static int indexOf ( Object o , Object [ ] elements , int index , int fence ) { if ( o == null ) { for ( int i = index ; i < fence ; i ++ ) if ( elements [ i ] == null ) return i ; } else { for ( int i = index ; i < fence ; i ++ ) if ( o . equals ( elements [ i ] ) ) return i ; } return - 1 ; }
static version of indexOf to allow repeated calls without needing to re - acquire array each time .
39,113
private static int lastIndexOf ( Object o , Object [ ] elements , int index ) { if ( o == null ) { for ( int i = index ; i >= 0 ; i -- ) if ( elements [ i ] == null ) return i ; } else { for ( int i = index ; i >= 0 ; i -- ) if ( o . equals ( elements [ i ] ) ) return i ; } return - 1 ; }
static version of lastIndexOf .
39,114
public boolean addIfAbsent ( E e ) { final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { Object [ ] elements = getArray ( ) ; int len = elements . length ; Object [ ] newElements = new Object [ len + 1 ] ; for ( int i = 0 ; i < len ; ++ i ) { if ( eq ( e , elements [ i ] ) ) return false ; else newElements [ i ] = elements [ i ] ; } newElements [ len ] = e ; setArray ( newElements ) ; return true ; } finally { lock . unlock ( ) ; } }
Append the element if not present .
39,115
public boolean removeAll ( Collection < ? > c ) { final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { Object [ ] elements = getArray ( ) ; int len = elements . length ; if ( len != 0 ) { int newlen = 0 ; Object [ ] temp = new Object [ len ] ; for ( int i = 0 ; i < len ; ++ i ) { Object element = elements [ i ] ; if ( ! c . contains ( element ) ) temp [ newlen ++ ] = element ; } if ( newlen != len ) { setArray ( Arrays . copyOf ( temp , newlen ) ) ; return true ; } } return false ; } finally { lock . unlock ( ) ; } }
Removes from this list all of its elements that are contained in the specified collection . This is a particularly expensive operation in this class because of the need for an internal temporary array .
39,116
public int addAllAbsent ( Collection < ? extends E > c ) { Object [ ] cs = c . toArray ( ) ; if ( cs . length == 0 ) return 0 ; Object [ ] uniq = new Object [ cs . length ] ; final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { Object [ ] elements = getArray ( ) ; int len = elements . length ; int added = 0 ; for ( int i = 0 ; i < cs . length ; ++ i ) { Object e = cs [ i ] ; if ( indexOf ( e , elements , 0 , len ) < 0 && indexOf ( e , uniq , 0 , added ) < 0 ) uniq [ added ++ ] = e ; } if ( added > 0 ) { Object [ ] newElements = Arrays . copyOf ( elements , len + added ) ; System . arraycopy ( uniq , 0 , newElements , len , added ) ; setArray ( newElements ) ; } return added ; } finally { lock . unlock ( ) ; } }
Appends all of the elements in the specified collection that are not already contained in this list to the end of this list in the order that they are returned by the specified collection s iterator .
39,117
public boolean addAll ( Collection < ? extends E > c ) { Object [ ] cs = c . toArray ( ) ; if ( cs . length == 0 ) return false ; final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { Object [ ] elements = getArray ( ) ; int len = elements . length ; Object [ ] newElements = Arrays . copyOf ( elements , len + cs . length ) ; System . arraycopy ( cs , 0 , newElements , len , cs . length ) ; setArray ( newElements ) ; return true ; } finally { lock . unlock ( ) ; } }
Appends all of the elements in the specified collection to the end of this list in the order that they are returned by the specified collection s iterator .
39,118
public Runnable discriminate ( HttpInboundConnectionExtended inboundConnection ) { String requestUri = inboundConnection . getRequest ( ) . getURI ( ) ; Runnable requestHandler = null ; for ( HttpContainerContext ctx : httpContainers ) { requestHandler = ctx . container . createRunnableHandler ( inboundConnection ) ; if ( requestHandler != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { if ( ! requestUri . endsWith ( "/" ) ) { int pos = requestUri . lastIndexOf ( '?' ) ; if ( pos >= 0 ) { requestUri = requestUri . substring ( 0 , pos ) ; } requestUri += "/" ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Discriminate " + requestUri , ctx . container ) ; } } break ; } } return requestHandler ; }
Given a new shiny inbound connection figure out which HttpContainer will handle the inbound request and return a Runnable that should be used to dispatch the work .
39,119
public static void generateLocalVariables ( JavaCodeWriter out , Element jspElement , String pageContextVar ) throws JspCoreException { if ( hasUseBean ( jspElement ) ) { out . println ( "HttpSession session = " + pageContextVar + ".getSession();" ) ; out . println ( "ServletContext application = " + pageContextVar + ".getServletContext();" ) ; } if ( hasUseBean ( jspElement ) || hasIncludeAction ( jspElement ) || hasSetProperty ( jspElement ) || hasForwardAction ( jspElement ) ) { out . println ( "HttpServletRequest request = (HttpServletRequest)" + pageContextVar + ".getRequest();" ) ; } if ( hasIncludeAction ( jspElement ) ) { out . println ( "HttpServletResponse response = (HttpServletResponse)" + pageContextVar + ".getResponse();" ) ; } }
PK65013 - already know if this isTagFile or not and pageContextVar is set accordingly
39,120
public static String interpreterCall ( boolean isTagFile , String expression , Class expectedType , String fnmapvar , boolean XmlEscape , String pageContextVar ) { return JSPExtensionFactory . getGeneratorUtilsExtFactory ( ) . getGeneratorUtilsExt ( ) . interpreterCall ( isTagFile , expression , expectedType , fnmapvar , XmlEscape , pageContextVar ) ; }
Produces a String representing a call to the EL interpreter .
39,121
public static String attributeValue ( String valueIn , boolean encode , Class expectedType , JspConfiguration jspConfig , boolean isTagFile , String pageContextVar ) { String value = valueIn ; value = value . replaceAll ( "&gt;" , ">" ) ; value = value . replaceAll ( "&lt;" , "<" ) ; value = value . replaceAll ( "&amp;" , "&" ) ; value = value . replaceAll ( "<\\%" , "<%" ) ; value = value . replaceAll ( "%\\>" , "%>" ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) { logger . logp ( Level . FINEST , CLASS_NAME , "attributeValue" , "valueIn = [" + valueIn + "]" ) ; logger . logp ( Level . FINEST , CLASS_NAME , "attributeValue" , "encode = [" + encode + "]" ) ; logger . logp ( Level . FINEST , CLASS_NAME , "attributeValue" , "expectedType = [" + expectedType + "]" ) ; logger . logp ( Level . FINEST , CLASS_NAME , "attributeValue" , "isTagFile = [" + isTagFile + "]" ) ; } if ( JspTranslatorUtil . isExpression ( value ) ) { value = value . substring ( 2 , value . length ( ) - 1 ) ; if ( encode ) { value = "org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(String.valueOf(" + value + "), request.getCharacterEncoding())" ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) { logger . logp ( Level . FINEST , CLASS_NAME , "attributeValue" , "isExpression. value = [" + value + "]" ) ; } } else if ( JspTranslatorUtil . isELInterpreterInput ( value , jspConfig ) ) { if ( encode ) { value = "org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(" + interpreterCall ( isTagFile , value , expectedType , "_jspx_fnmap" , false , pageContextVar ) + ", request.getCharacterEncoding())" ; } else { value = interpreterCall ( isTagFile , value , expectedType , "_jspx_fnmap" , false , pageContextVar ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) { logger . logp ( Level . FINEST , CLASS_NAME , "attributeValue" , "isELInterpreterInput. value = [" + value + "]" ) ; } } else { if ( encode ) { value = "org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(" + quote ( value ) + ", request.getCharacterEncoding())" ; } else { value = quote ( value ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) { logger . logp ( Level . FINEST , CLASS_NAME , "attributeValue" , "default. value = [" + value + "]" ) ; } } return ( value ) ; }
PK65013 add method parameter pageContextVar
39,122
Object [ ] getObjects ( ExtendedLogEntry logEntry , boolean translatedMsg ) { ArrayList < Object > list = new ArrayList < Object > ( 5 ) ; if ( translatedMsg && logEntry . getMessage ( ) != null ) { list . add ( logEntry . getMessage ( ) ) ; } if ( ! translatedMsg ) { String loggerName = logEntry . getLoggerName ( ) ; if ( loggerName != null ) { list . add ( String . format ( "LoggerName:%s" , loggerName ) ) ; } } ServiceReference < ? > sr = logEntry . getServiceReference ( ) ; if ( sr != null ) { String sString = String . format ( "ServiceRef:%s(id=%s, pid=%s)" , java . util . Arrays . asList ( ( String [ ] ) sr . getProperty ( "objectClass" ) ) , sr . getProperty ( "service.id" ) , sr . getProperty ( "service.pid" ) ) ; list . add ( sString ) ; } Throwable t = logEntry . getException ( ) ; if ( t != null ) { list . add ( t ) ; } Object event = logEntry . getContext ( ) ; if ( event instanceof EventObject ) { String sString = String . format ( "Event:%s" , event . toString ( ) ) ; list . add ( sString ) ; } if ( translatedMsg ) { while ( list . size ( ) < 4 ) list . add ( "" ) ; } return list . toArray ( ) ; }
Analyze available fields from the LogEntry and make a suitable object array for passing to trace .
39,123
private void addToLoggedOutTokenCache ( String tokenString ) { String tokenValue = "userName" ; LoggedOutTokenCacheImpl . getInstance ( ) . addTokenToDistributedMap ( tokenString , tokenValue ) ; }
Add the ltpa token string to the logged out token distributed map .
39,124
private void removeEntryFromAuthCache ( HttpServletRequest req , HttpServletResponse res , WebAppSecurityConfig config ) { removeEntryFromAuthCacheForUser ( req , res ) ; removeEntryFromAuthCacheForToken ( req , res , config ) ; }
Remove entries in the authentication cache
39,125
private void removeEntryFromAuthCacheForToken ( HttpServletRequest req , HttpServletResponse res , WebAppSecurityConfig config ) { getAuthCacheService ( ) ; if ( authCacheService == null ) { return ; } Cookie [ ] cookies = req . getCookies ( ) ; if ( cookies != null ) { String cookieValues [ ] = null ; cookieValues = CookieHelper . getCookieValues ( cookies , ssoCookieHelper . getSSOCookiename ( ) ) ; if ( ( cookieValues == null || cookieValues . length == 0 ) && ! SSOAuthenticator . DEFAULT_SSO_COOKIE_NAME . equalsIgnoreCase ( ssoCookieHelper . getSSOCookiename ( ) ) ) { cookieValues = CookieHelper . getCookieValues ( cookies , SSOAuthenticator . DEFAULT_SSO_COOKIE_NAME ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Cookie size: " , cookieValues == null ? "<null>" : cookieValues . length ) ; if ( cookieValues != null && cookieValues . length > 0 ) { for ( int n = 0 ; n < cookieValues . length ; n ++ ) { String val = cookieValues [ n ] ; if ( val != null && val . length ( ) > 0 ) { try { authCacheService . remove ( val ) ; if ( config . isTrackLoggedOutSSOCookiesEnabled ( ) ) addToLoggedOutTokenCache ( val ) ; } catch ( Exception e ) { String user = req . getRemoteUser ( ) ; if ( user == null ) { Principal p = req . getUserPrincipal ( ) ; if ( p != null ) user = p . getName ( ) ; } Tr . warning ( tc , "AUTHENTICATE_CACHE_REMOVAL_EXCEPTION" , user , e . toString ( ) ) ; } } } } } }
Remove entries in the authentication cache using the ltpaToken as a key
39,126
private void removeEntryFromAuthCacheForUser ( HttpServletRequest req , HttpServletResponse res ) { getAuthCacheService ( ) ; if ( authCacheService == null ) { return ; } String user = req . getRemoteUser ( ) ; if ( user == null ) { Principal p = req . getUserPrincipal ( ) ; if ( p != null ) user = p . getName ( ) ; } if ( user != null ) { if ( collabUtils != null ) { String realm = collabUtils . getUserRegistryRealm ( securityServiceRef ) ; if ( ! user . contains ( realm + ":" ) ) { user = realm + ":" + user ; } } authCacheService . remove ( user ) ; } }
Remove entries in the authentication cache using the user as a key
39,127
public void throwExceptionIfAlreadyAuthenticate ( HttpServletRequest req , HttpServletResponse resp , WebAppSecurityConfig config , String username ) throws ServletException { Subject callerSubject = subjectManager . getCallerSubject ( ) ; if ( subjectHelper . isUnauthenticated ( callerSubject ) ) return ; if ( ! config . getWebAlwaysLogin ( ) ) { AuthenticationResult authResult = new AuthenticationResult ( AuthResult . FAILURE , username ) ; authResult . setAuditCredType ( req . getAuthType ( ) ) ; authResult . setAuditCredValue ( username ) ; authResult . setAuditOutcome ( AuditEvent . OUTCOME_FAILURE ) ; Audit . audit ( Audit . EventID . SECURITY_API_AUTHN_01 , req , authResult , Integer . valueOf ( HttpServletResponse . SC_UNAUTHORIZED ) ) ; throw new ServletException ( "Authentication had been already established" ) ; } logout ( req , resp , config ) ; }
This method throws an exception if the caller subject is already authenticated and WebAlwaysLogin is false . If the caller subject is already authenticated and WebAlwaysLogin is true then it will logout the user .
39,128
private void invalidateSession ( HttpServletRequest req ) { HttpSession session = req . getSession ( false ) ; if ( session != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "invalidating existing HTTP Session" ) ; session . invalidate ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Existing HTTP Session does not exist, nothing to invalidate" ) ; } }
Invalidates the session associated with the request .
39,129
private void createSubjectAndPushItOnThreadAsNeeded ( HttpServletRequest req , HttpServletResponse res ) { logoutSubject = null ; Subject subject = subjectManager . getCallerSubject ( ) ; if ( subject == null || subjectHelper . isUnauthenticated ( subject ) ) { if ( authService == null && securityServiceRef != null ) { authService = securityServiceRef . getService ( ) . getAuthenticationService ( ) ; } SSOAuthenticator ssoAuthenticator = new SSOAuthenticator ( authService , null , null , ssoCookieHelper ) ; AuthenticationResult authResult = ssoAuthenticator . handleSSO ( req , res ) ; if ( authResult != null && authResult . getStatus ( ) == AuthResult . SUCCESS ) { subjectManager . setCallerSubject ( authResult . getSubject ( ) ) ; logoutSubject = authResult . getSubject ( ) ; } } }
For formLogout this is a new request and there is no subject on the thread . A previous request handled on this thread may not be from this same client . We have to authenticate using the token and push the subject on thread so webcontainer can use the subject credential to invalidate the session .
39,130
String debugGetAllHttpHdrs ( HttpServletRequest req ) { if ( req == null ) return null ; StringBuffer sb = new StringBuffer ( 512 ) ; Enumeration < String > headerNames = req . getHeaderNames ( ) ; while ( headerNames != null && headerNames . hasMoreElements ( ) ) { String headerName = headerNames . nextElement ( ) ; sb . append ( headerName ) . append ( "=" ) ; sb . append ( "[" ) . append ( SRTServletRequestUtils . getHeader ( req , headerName ) ) . append ( "]\n" ) ; } return sb . toString ( ) ; }
Debug method used to collect all the Http header names and values .
39,131
public void processException ( Class sourceClass , String methodName , Throwable throwable , String probe ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( cclass , "processException" , new Object [ ] { sourceClass , methodName , throwable , probe } ) ; print ( null , sourceClass , methodName , throwable , probe , null , null ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( cclass , "processException" ) ; }
Process an exception for a static class .
39,132
public static Properties loadRepoProperties ( ) throws InstallException { Properties repoProperties = null ; File repoPropertiesFile = new File ( getRepoPropertiesFileLocation ( ) ) ; boolean isPropsLocationOverridden = System . getProperty ( InstallConstants . OVERRIDE_PROPS_LOCATION_ENV_VAR ) != null ? true : false ; if ( repoPropertiesFile . exists ( ) && repoPropertiesFile . isFile ( ) ) { repoProperties = new Properties ( ) ; FileInputStream repoPropertiesInput = null ; try { repoPropertiesInput = new FileInputStream ( repoPropertiesFile ) ; repoProperties . load ( repoPropertiesInput ) ; } catch ( Exception e ) { throw new InstallException ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_TOOL_REPOSITORY_PROPS_NOT_LOADED" , getRepoPropertiesFileLocation ( ) ) , InstallException . IO_FAILURE ) ; } finally { InstallUtils . close ( repoPropertiesInput ) ; } } else if ( isPropsLocationOverridden ) { throw new InstallException ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( repoPropertiesFile . isDirectory ( ) ? "ERROR_TOOL_REPOSITORY_PROPS_NOT_FILE" : "ERROR_TOOL_REPOSITORY_PROPS_NOT_EXISTS" , getRepoPropertiesFileLocation ( ) ) , InstallException . IO_FAILURE ) ; } return repoProperties ; }
Loads the repository properties into a Properties object
39,133
public static String getRepoPropertiesFileLocation ( ) { String installDirPath = Utils . getInstallDir ( ) . getAbsolutePath ( ) ; String overrideLocation = System . getProperty ( InstallConstants . OVERRIDE_PROPS_LOCATION_ENV_VAR ) ; if ( overrideLocation == null ) { return installDirPath + InstallConstants . DEFAULT_REPO_PROPERTIES_LOCATION ; } else { return overrideLocation ; } }
Finds the repository properties file location
39,134
public static void setProxyAuthenticator ( final String proxyHost , final String proxyPort , final String proxyUser , final String decodedPwd ) { if ( proxyUser == null || proxyUser . isEmpty ( ) || decodedPwd == null || decodedPwd . isEmpty ( ) ) { return ; } Authenticator . setDefault ( new Authenticator ( ) { public PasswordAuthentication getPasswordAuthentication ( ) { if ( getRequestorType ( ) == RequestorType . PROXY ) { if ( getRequestingHost ( ) . equals ( proxyHost ) && getRequestingPort ( ) == Integer . valueOf ( proxyPort ) ) { return new PasswordAuthentication ( proxyUser , decodedPwd . toCharArray ( ) ) ; } } return null ; } } ) ; }
Set Proxy Authenticator Default
39,135
public static String getProxyPwd ( Properties repoProperties ) { if ( repoProperties . getProperty ( InstallConstants . REPO_PROPERTIES_PROXY_USERPWD ) != null ) return repoProperties . getProperty ( InstallConstants . REPO_PROPERTIES_PROXY_USERPWD ) ; else if ( repoProperties . getProperty ( InstallConstants . REPO_PROPERTIES_PROXY_PWD ) != null ) return repoProperties . getProperty ( InstallConstants . REPO_PROPERTIES_PROXY_PWD ) ; else return null ; }
Gets the Proxy user password .
39,136
public static List < String > getOrderList ( Properties repoProperties ) throws InstallException { List < String > orderList = new ArrayList < String > ( ) ; List < String > repoList = new ArrayList < String > ( ) ; File repoPropertiesFile = new File ( getRepoPropertiesFileLocation ( ) ) ; if ( repoPropertiesFile . exists ( ) && repoPropertiesFile . isFile ( ) ) { FileInputStream repoPropertiesInput = null ; BufferedReader repoPropertiesReader = null ; try { repoPropertiesInput = new FileInputStream ( repoPropertiesFile ) ; repoPropertiesReader = new BufferedReader ( new InputStreamReader ( repoPropertiesInput ) ) ; String line ; String repoName ; while ( ( line = repoPropertiesReader . readLine ( ) ) != null ) { String keyValue [ ] = line . split ( EQUALS ) ; if ( ! line . startsWith ( COMMENT_PREFIX ) && keyValue . length > 1 && keyValue [ 0 ] . endsWith ( URL_SUFFIX ) ) { repoName = keyValue [ 0 ] . substring ( 0 , keyValue [ 0 ] . length ( ) - URL_SUFFIX . length ( ) ) ; if ( repoName . isEmpty ( ) ) { continue ; } if ( orderList . contains ( repoName ) ) { repoList . remove ( orderList . indexOf ( repoName ) ) ; orderList . remove ( repoName ) ; } orderList . add ( repoName ) ; repoList . add ( line ) ; if ( InstallUtils . isWindows && keyValue . length > 1 && keyValue [ 1 ] . contains ( "\\" ) ) { String url = repoProperties . getProperty ( keyValue [ 0 ] ) ; if ( url != null && ! InstallUtils . isURL ( url ) ) { repoProperties . put ( keyValue [ 0 ] , keyValue [ 1 ] . trim ( ) ) ; logger . log ( Level . FINEST , "The value of " + keyValue [ 0 ] + " was replaced to " + repoProperties . getProperty ( keyValue [ 0 ] ) ) ; } } } } } catch ( IOException e ) { throw new InstallException ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_TOOL_REPOSITORY_PROPS_NOT_LOADED" , getRepoPropertiesFileLocation ( ) ) , InstallException . IO_FAILURE ) ; } finally { InstallUtils . close ( repoPropertiesInput ) ; InstallUtils . close ( repoPropertiesReader ) ; } } if ( isWlpRepoEnabled ( repoProperties ) ) { orderList . add ( WLP_REPO ) ; } return orderList ; }
Compiles a list of repository names from a repository properties file removing duplicates and . url suffixes
39,137
public static boolean isWlpRepoEnabled ( Properties repoProperties ) { if ( ! repoPropertiesFileExists ( ) || repoProperties == null ) return true ; String wlpEnabled = repoProperties . getProperty ( USE_WLP_REPO ) ; if ( wlpEnabled == null ) return true ; return ! wlpEnabled . trim ( ) . equalsIgnoreCase ( "false" ) ; }
Checks if the repository uses the WLP repository
39,138
public static List < RepositoryConfig > getRepositoryConfigs ( Properties repoProperties ) throws InstallException { List < String > orderList = getOrderList ( repoProperties ) ; List < RepositoryConfig > connections = new ArrayList < RepositoryConfig > ( orderList . size ( ) ) ; if ( repoProperties == null || repoProperties . isEmpty ( ) ) { connections . add ( new RepositoryConfig ( WLP_REPO , null , null , null , null ) ) ; return connections ; } for ( String r : orderList ) { if ( r . equalsIgnoreCase ( WLP_REPO ) ) { connections . add ( new RepositoryConfig ( WLP_REPO , null , null , null , null ) ) ; continue ; } String url = repoProperties . getProperty ( r + URL_SUFFIX ) ; String user = null ; String userPwd = null ; if ( url != null && ! url . isEmpty ( ) ) { user = repoProperties . getProperty ( r + USER_SUFFIX ) ; if ( user != null ) { if ( user . isEmpty ( ) ) user = null ; else { userPwd = repoProperties . getProperty ( r + PWD_SUFFIX ) ; if ( userPwd == null || userPwd . isEmpty ( ) ) { userPwd = repoProperties . getProperty ( r + USERPWD_SUFFIX ) ; } if ( userPwd != null && userPwd . isEmpty ( ) ) userPwd = null ; } } String apiKey = repoProperties . getProperty ( r + APIKEY_SUFFIX ) ; url = url . trim ( ) ; if ( ! InstallUtils . isURL ( url ) ) { File f = new File ( url ) ; try { url = f . toURI ( ) . toURL ( ) . toString ( ) ; } catch ( MalformedURLException e1 ) { logger . log ( Level . FINEST , "Failed to convert " + f . getAbsolutePath ( ) + " to url format" , e1 ) ; } } connections . add ( new RepositoryConfig ( r , url , apiKey , user , userPwd ) ) ; } } if ( connections . isEmpty ( ) ) { throw new InstallException ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_NO_REPO_WAS_ENABLED" ) ) ; } return connections ; }
Compiles a list of repository names from a repository properties file .
39,139
public static String getRepoName ( Properties repoProperties , RepositoryConnection repoConn ) throws InstallException { String repoName = null ; List < RepositoryConfig > configRepos = RepositoryConfigUtils . getRepositoryConfigs ( repoProperties ) ; if ( ! ( repoConn instanceof DirectoryRepositoryConnection || repoConn instanceof ZipRepositoryConnection ) ) { if ( RepositoryConfigUtils . isLibertyRepository ( ( RestRepositoryConnection ) repoConn , repoProperties ) ) return WLP_REPO ; } for ( RepositoryConfig rc : configRepos ) { if ( rc . getUrl ( ) != null ) { if ( rc . getUrl ( ) . toLowerCase ( ) . startsWith ( "file:" ) && ( repoConn instanceof DirectoryRepositoryConnection || repoConn instanceof ZipRepositoryConnection ) ) { String repoDir = rc . getUrl ( ) ; try { URL fileURL = new URL ( repoDir ) ; File repoFile = new File ( fileURL . getPath ( ) ) ; if ( repoFile . getAbsolutePath ( ) . equalsIgnoreCase ( repoConn . getRepositoryLocation ( ) ) ) { repoName = rc . getId ( ) ; break ; } } catch ( Exception e ) { throw new InstallException ( RepositoryUtils . getMessage ( "ERROR_DIRECTORY_NOT_EXISTS" , repoDir ) ) ; } } else { if ( rc . getUrl ( ) . equalsIgnoreCase ( repoConn . getRepositoryLocation ( ) ) ) { repoName = rc . getId ( ) ; break ; } } } } return repoName ; }
Gets the name of the repository by connection and properties
39,140
public static boolean isLibertyRepository ( RestRepositoryConnection lie , Properties repoProperties ) throws InstallException { if ( isWlpRepoEnabled ( repoProperties ) ) { return lie . getRepositoryLocation ( ) . startsWith ( InstallConstants . REPOSITORY_LIBERTY_URL ) ; } return false ; }
Checks if the inputed Repository Connection is a liberty repository
39,141
private static boolean isKeySupported ( String key ) { if ( Arrays . asList ( SUPPORTED_KEYS ) . contains ( key ) ) return true ; if ( key . endsWith ( URL_SUFFIX ) || key . endsWith ( APIKEY_SUFFIX ) || key . endsWith ( USER_SUFFIX ) || key . endsWith ( PWD_SUFFIX ) || key . endsWith ( USERPWD_SUFFIX ) ) return true ; return false ; }
Checks if the inputed key is a supported property key
39,142
private boolean isFirstRequestProcessed ( ) { FacesContext context = FacesContext . getCurrentInstance ( ) ; if ( ! _firstRequestProcessed && context != null && Boolean . TRUE . equals ( context . getExternalContext ( ) . getApplicationMap ( ) . containsKey ( LifecycleImpl . FIRST_REQUEST_PROCESSED_PARAM ) ) ) { _firstRequestProcessed = true ; } return _firstRequestProcessed ; }
Method to handle determining if the first request has been handled by the associated LifecycleImpl .
39,143
public static Object claimFromJsonObject ( String jsonFormattedString , String claimName ) throws JoseException { Object claim = null ; Map < String , Object > jobj = org . jose4j . json . JsonUtil . parseJson ( jsonFormattedString ) ; if ( jobj != null ) { claim = jobj . get ( claimName ) ; } return claim ; }
either from header or payload
39,144
public static Map claimsFromJsonObject ( String jsonFormattedString ) throws JoseException { Map claimsMap = new ConcurrentHashMap < String , Object > ( ) ; Map < String , Object > jobj = org . jose4j . json . JsonUtil . parseJson ( jsonFormattedString ) ; Set < Entry < String , Object > > entries = jobj . entrySet ( ) ; Iterator < Entry < String , Object > > it = entries . iterator ( ) ; while ( it . hasNext ( ) ) { Entry < String , Object > entry = it . next ( ) ; String key = entry . getKey ( ) ; Object value = entry . getValue ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Key : " + key + ", Value: " + value ) ; } if ( ! isNullEmpty ( key ) && value != null ) { claimsMap . put ( key , value ) ; } } return claimsMap ; }
assuming payload not the whole token string
39,145
public static List < String > trimIt ( String [ ] strings ) { if ( strings == null || strings . length == 0 ) { return null ; } List < String > results = new ArrayList < String > ( ) ; for ( int i = 0 ; i < strings . length ; i ++ ) { String result = trimIt ( strings [ i ] ) ; if ( result != null ) { results . add ( result ) ; } } if ( results . size ( ) > 0 ) { return results ; } else { return null ; } }
Trims each of the strings in the array provided and returns a new list with each string added to it . If the trimmed string is empty that string will not be added to the final array . If no entries are present in the final array null is returned .
39,146
protected void invokeCollectorIfPresent ( ) { if ( collectorProxy != null ) { Serializable data = collectorProxy . collectPartitionData ( ) ; logger . finer ( "Got partition data: " + data + ", from collector: " + collectorProxy ) ; sendCollectorDataPartitionReplyMsg ( data ) ; } }
Invoke the user - supplied PartitionCollectorProxy and send the data back to the top - level thread .
39,147
protected void sendCollectorDataPartitionReplyMsg ( Serializable data ) { if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "Sending collector partition data: " + data + " to analyzer queue: " + getPartitionReplyQueue ( ) ) ; } PartitionReplyMsg msg = new PartitionReplyMsg ( PartitionReplyMsgType . PARTITION_COLLECTOR_DATA ) . setCollectorData ( serializeToByteArray ( data ) ) ; getPartitionReplyQueue ( ) . add ( msg ) ; }
Send sub - job partition thread data back to top - level thread via analyzerStatusQueue .
39,148
private void initialize ( Chunk chunk ) { final String mName = "initialize" ; if ( logger . isLoggable ( Level . FINER ) ) logger . entering ( className , mName ) ; try { if ( chunk . getSkipLimit ( ) != null ) { _skipLimit = Integer . parseInt ( chunk . getSkipLimit ( ) ) ; if ( _skipLimit < 0 ) { throw new IllegalArgumentException ( "The skip-limit attribute on a chunk cannot be a negative value" ) ; } } } catch ( NumberFormatException nfe ) { throw new RuntimeException ( "NumberFormatException reading " + SKIP_COUNT , nfe ) ; } _skipIncludeExceptions = new HashSet < String > ( ) ; _skipExcludeExceptions = new HashSet < String > ( ) ; if ( chunk . getSkippableExceptionClasses ( ) != null ) { if ( chunk . getSkippableExceptionClasses ( ) . getIncludeList ( ) != null ) { List < ExceptionClassFilter . Include > includes = chunk . getSkippableExceptionClasses ( ) . getIncludeList ( ) ; for ( ExceptionClassFilter . Include include : includes ) { _skipIncludeExceptions . add ( include . getClazz ( ) . trim ( ) ) ; logger . finer ( "SKIPHANDLE: include: " + include . getClazz ( ) . trim ( ) ) ; } if ( _skipIncludeExceptions . size ( ) == 0 ) { logger . finer ( "SKIPHANDLE: include element not present" ) ; } } } if ( chunk . getSkippableExceptionClasses ( ) != null ) { if ( chunk . getSkippableExceptionClasses ( ) . getExcludeList ( ) != null ) { List < ExceptionClassFilter . Exclude > excludes = chunk . getSkippableExceptionClasses ( ) . getExcludeList ( ) ; for ( ExceptionClassFilter . Exclude exclude : excludes ) { _skipExcludeExceptions . add ( exclude . getClazz ( ) . trim ( ) ) ; logger . finer ( "SKIPHANDLE: exclude: " + exclude . getClazz ( ) . trim ( ) ) ; } if ( _skipExcludeExceptions . size ( ) == 0 ) { logger . finer ( "SKIPHANDLE: exclude element not present" ) ; } } } excMatcher = new ExceptionMatcher ( _skipIncludeExceptions , _skipExcludeExceptions ) ; if ( logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , className , mName , "added include exception " + _skipIncludeExceptions + "; added exclude exception " + _skipExcludeExceptions ) ; if ( logger . isLoggable ( Level . FINER ) ) logger . exiting ( className , mName , this . toString ( ) ) ; }
Read the skip exception lists from the BDS props .
39,149
public static String getSymbol ( String s ) { String outputSymbol = null ; if ( s != null ) { if ( s . length ( ) > 3 ) { int pos = s . indexOf ( '$' ) ; if ( pos >= 0 ) { int pos2 = pos + 1 ; if ( s . length ( ) > pos2 ) { if ( s . charAt ( pos2 ) == '{' ) { pos2 = s . indexOf ( '}' , pos2 ) ; if ( pos2 >= 0 ) { outputSymbol = s . substring ( pos , pos2 + 1 ) ; } } } } } } return outputSymbol ; }
Answer the first symbolic substitution within a path .
39,150
public static String getChildUnder ( String path , String parentPath ) { int start = parentPath . length ( ) ; String local = path . substring ( start , path . length ( ) ) ; String name = getFirstPathComponent ( local ) ; return name ; }
Answer the first path element of a path which follows a leading sub - path .
39,151
public static boolean isNormalizedPathAbsolute ( String nPath ) { boolean retval = ".." . equals ( nPath ) || nPath . startsWith ( "../" ) || nPath . startsWith ( "/.." ) ; return ! retval ; }
Tell if a path if applied to a target location will reach above the target location . The path must use forward slashes and must have all .. elements resolved .
39,152
public static String checkAndNormalizeRootPath ( String path ) throws IllegalArgumentException { path = PathUtils . normalizeUnixStylePath ( path ) ; if ( ! PathUtils . isNormalizedPathAbsolute ( path ) ) { throw new IllegalArgumentException ( ) ; } if ( ! path . startsWith ( "/" ) ) { path = '/' + path ; } if ( path . endsWith ( "/" ) ) { path = path . substring ( 0 , path . length ( ) - 1 ) ; } if ( path . equals ( "/" ) || path . equals ( "" ) ) { throw new IllegalArgumentException ( ) ; } return path ; }
Resolve all .. elements of a path . The path must use forward slashes .
39,153
public static boolean checkCase ( final File file , String pathToTest ) { if ( pathToTest == null || pathToTest . isEmpty ( ) ) { return true ; } if ( IS_OS_CASE_SENSITIVE ) { return true ; } try { if ( checkCaseCanonical ( file , pathToTest ) ) { return true ; } return checkCaseSymlink ( file , pathToTest ) ; } catch ( PrivilegedActionException e ) { return false ; } }
The artifact API is case sensitive even on a file system that is not case sensitive .
39,154
private static boolean checkCaseCanonical ( final File file , String pathToTest ) throws PrivilegedActionException { String onDiskCanonicalPath = AccessController . doPrivileged ( new PrivilegedExceptionAction < String > ( ) { public String run ( ) throws IOException { return file . getCanonicalPath ( ) ; } } ) ; onDiskCanonicalPath = onDiskCanonicalPath . replace ( "\\" , "/" ) ; final String expectedEnding ; if ( onDiskCanonicalPath . endsWith ( "/" ) ) { if ( pathToTest . endsWith ( "/" ) ) { expectedEnding = pathToTest ; } else { expectedEnding = pathToTest + "/" ; } } else { if ( pathToTest . endsWith ( "/" ) ) { expectedEnding = pathToTest . substring ( 0 , pathToTest . length ( ) - 1 ) ; } else { expectedEnding = pathToTest ; } } if ( expectedEnding . isEmpty ( ) ) { return true ; } return onDiskCanonicalPath . endsWith ( expectedEnding ) ; }
Test that the path to a file matches a specified path .
39,155
private static boolean checkCaseSymlink ( File file , String pathToTest ) throws PrivilegedActionException { if ( pathToTest . startsWith ( "/" ) ) pathToTest = pathToTest . substring ( 1 ) ; String [ ] splitPathToTest = pathToTest . split ( "/" ) ; File symLinkTestFile = file ; for ( int i = splitPathToTest . length - 1 ; i >= 0 ; i -- ) { File symLinkParentFile = symLinkTestFile . getParentFile ( ) ; if ( symLinkParentFile == null ) { return false ; } if ( ! isSymbolicLink ( symLinkTestFile , symLinkParentFile ) ) { if ( ! getCanonicalFile ( symLinkTestFile ) . getName ( ) . equals ( splitPathToTest [ i ] ) ) { return false ; } } else if ( ! contains ( symLinkParentFile . list ( ) , splitPathToTest [ i ] ) ) { return false ; } symLinkTestFile = symLinkParentFile ; } return true ; }
Test if a file is reached by a path . Handle symbolic links . The test uses the canonical path of the file and does a case sensitive string comparison .
39,156
private static boolean isSymbolicLink ( final File file , File parentFile ) throws PrivilegedActionException { File canonicalParentDir = getCanonicalFile ( parentFile ) ; File fileInCanonicalParentDir = new File ( canonicalParentDir , file . getName ( ) ) ; File canonicalFile = getCanonicalFile ( fileInCanonicalParentDir ) ; return ! canonicalFile . equals ( fileInCanonicalParentDir . getAbsoluteFile ( ) ) ; }
Test if a file is a symbolic link . Test only the file . A symbolic link elsewhere in the path to the file is not detected .
39,157
protected void setVariableRegistry ( ServiceReference < VariableRegistry > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setVariableRegistry" , ref ) ; variableRegistryRef . setReference ( ref ) ; }
Declarative Services method for setting the VariableRegistry service reference .
39,158
protected void unsetVariableRegistry ( ServiceReference < VariableRegistry > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unsetVariableRegistry" , ref ) ; variableRegistryRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the VariableRegistry service reference .
39,159
protected void setWsConfigurationHelper ( ServiceReference < WSConfigurationHelper > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setWSConfigurationHelper" , ref ) ; wsConfigurationHelperRef . setReference ( ref ) ; }
Declarative Services method for setting the WSConfigurationHelper service reference .
39,160
protected void unsetWsConfigurationHelper ( ServiceReference < WSConfigurationHelper > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unsetVariableRegistry" , ref ) ; wsConfigurationHelperRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the WSConfigurationHelper service reference .
39,161
protected void setMetaTypeService ( ServiceReference < MetaTypeService > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setMetaTypeService" , ref ) ; metaTypeServiceRef . setReference ( ref ) ; }
Declarative Services method for setting the MetaTypeService service reference .
39,162
protected void unsetMetaTypeService ( ServiceReference < MetaTypeService > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unsetMetaTypeService" , ref ) ; metaTypeServiceRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the MetaTypeService service reference .
39,163
private static < T > T getContextualReference ( Class < T > type , BeanManager beanManager , Set < Bean < ? > > beans ) { Bean < ? > bean = beanManager . resolve ( beans ) ; CreationalContext < ? > creationalContext = beanManager . createCreationalContext ( bean ) ; @ SuppressWarnings ( { "unchecked" , "UnnecessaryLocalVariable" } ) T result = ( T ) beanManager . getReference ( bean , type , creationalContext ) ; return result ; }
Internal helper method to resolve the right bean and resolve the contextual reference .
39,164
public static String printStatus ( int status ) { switch ( status ) { case Status . STATUS_ACTIVE : return "Status.STATUS_ACTIVE" ; case Status . STATUS_COMMITTED : return "Status.STATUS_COMMITTED" ; case Status . STATUS_COMMITTING : return "Status.STATUS_COMMITTING" ; case Status . STATUS_MARKED_ROLLBACK : return "Status.STATUS_MARKED_ROLLBACK" ; case Status . STATUS_NO_TRANSACTION : return "Status.STATUS_NO_TRANSACTION" ; case Status . STATUS_PREPARED : return "Status.STATUS_PREPARED" ; case Status . STATUS_PREPARING : return "Status.STATUS_PREPARING" ; case Status . STATUS_ROLLEDBACK : return "Status.STATUS_ROLLEDBACK" ; case Status . STATUS_ROLLING_BACK : return "Status.STATUS_ROLLING_BACK" ; default : return "Status.STATUS_UNKNOWN" ; } }
Convert JTA transaction status to String representation
39,165
public static String printFlag ( int flags ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( Integer . toHexString ( flags ) ) ; sb . append ( "=" ) ; if ( flags == XAResource . TMNOFLAGS ) { sb . append ( "TMNOFLAGS" ) ; } else { if ( ( flags & XAResource . TMENDRSCAN ) != 0 ) sb . append ( "TMENDRSCAN|" ) ; if ( ( flags & XAResource . TMFAIL ) != 0 ) sb . append ( "TMFAIL|" ) ; if ( ( flags & XAResource . TMJOIN ) != 0 ) sb . append ( "TMJOIN|" ) ; if ( ( flags & XAResource . TMONEPHASE ) != 0 ) sb . append ( "TMONEPHASE|" ) ; if ( ( flags & XAResource . TMRESUME ) != 0 ) sb . append ( "TMRESUME|" ) ; if ( ( flags & XAResource . TMSTARTRSCAN ) != 0 ) sb . append ( "TMSTARTRSCAN|" ) ; if ( ( flags & XAResource . TMSUCCESS ) != 0 ) sb . append ( "TMSUCCESS|" ) ; if ( ( flags & XAResource . TMSUSPEND ) != 0 ) sb . append ( "TMSUSPEND|" ) ; sb . deleteCharAt ( sb . length ( ) - 1 ) ; } return sb . toString ( ) ; }
Translate flags defined in javax . transaction . xa . XAResource into string representation
39,166
public static String identity ( java . lang . Object x ) { if ( x == null ) return "" + x ; return ( x . getClass ( ) . getName ( ) + "@" + Integer . toHexString ( System . identityHashCode ( x ) ) ) ; }
toString Helper when object is Corba Ref and we do not want IOR in the trace
39,167
public static byte [ ] duplicateByteArray ( byte [ ] in , int offset , int length ) { if ( in == null ) return null ; byte [ ] out = new byte [ length ] ; System . arraycopy ( in , offset , out , 0 , length ) ; return out ; }
Duplicate a piece of a byte array .
39,168
public static void setBytesFromInt ( byte [ ] bytes , int offset , int byteCount , int value ) { long maxval = ( ( 1L << ( 8 * byteCount ) ) - 1 ) ; if ( value > maxval ) { final String msg = "value too large for byteCount" ; IllegalArgumentException iae = new IllegalArgumentException ( msg ) ; FFDCFilter . processException ( iae , "com.ibm.ws.Transaction.JTA.Util.setBytesFromInt" , "579" ) ; throw iae ; } switch ( byteCount ) { case 4 : bytes [ offset ++ ] = ( byte ) ( ( value >> 24 ) & 0xFF ) ; case 3 : bytes [ offset ++ ] = ( byte ) ( ( value >> 16 ) & 0xFF ) ; case 2 : bytes [ offset ++ ] = ( byte ) ( ( value >> 8 ) & 0xFF ) ; case 1 : bytes [ offset ++ ] = ( byte ) ( ( value ) & 0xFF ) ; break ; default : final String msg = "byteCount is not between 1 and 4" ; IllegalArgumentException iae = new IllegalArgumentException ( msg ) ; FFDCFilter . processException ( iae , "com.ibm.ws.Transaction.JTA.Util.setBytesFromInt" , "598" ) ; throw iae ; } }
Utility function to set sequence numbers in big - endian format in a byte array .
39,169
public static long getLongFromBytes ( byte [ ] bytes , int offset ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getLongFromBytes: length = " + bytes . length + ", data = " + toHexString ( bytes ) ) ; long result = - 1 ; if ( bytes . length >= offset + 8 ) { result = ( ( bytes [ 0 + offset ] & 0xff ) << 56 ) + ( ( bytes [ 1 + offset ] & 0xff ) << 48 ) + ( ( bytes [ 2 + offset ] & 0xff ) << 40 ) + ( ( bytes [ 3 + offset ] & 0xff ) << 32 ) + ( ( bytes [ 4 + offset ] & 0xff ) << 24 ) + ( ( bytes [ 5 + offset ] & 0xff ) << 16 ) + ( ( bytes [ 6 + offset ] & 0xff ) << 8 ) + ( bytes [ 7 + offset ] & 0xff ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getLongFromBytes " + result ) ; return result ; }
Utility function which extracts a long from a byte array representation in big endian format
39,170
public static byte [ ] longToBytes ( long rmid ) { return new byte [ ] { ( byte ) ( rmid >> 56 ) , ( byte ) ( rmid >> 48 ) , ( byte ) ( rmid >> 40 ) , ( byte ) ( rmid >> 32 ) , ( byte ) ( rmid >> 24 ) , ( byte ) ( rmid >> 16 ) , ( byte ) ( rmid >> 8 ) , ( byte ) ( rmid ) } ; }
Utility function which transfers a long to a byte array in big endian format .
39,171
public static boolean equal ( byte [ ] a , byte [ ] b ) { if ( a == b ) return ( true ) ; if ( ( a == null ) || ( b == null ) ) return ( false ) ; if ( a . length != b . length ) return ( false ) ; for ( int i = 0 ; i < a . length ; i ++ ) if ( a [ i ] != b [ i ] ) return ( false ) ; return ( true ) ; }
Returns true if the byte arrays are identical ; false otherwise .
39,172
public static String byteArrayToString ( byte [ ] b ) { final int l = b . length / 2 ; if ( l * 2 != b . length ) throw new IllegalArgumentException ( ) ; StringBuffer result = new StringBuffer ( l ) ; int o = 0 ; for ( int i = 0 ; i < l ; i ++ ) { int i1 = b [ o ++ ] & 0xff ; int i2 = b [ o ++ ] & 0xff ; i2 = i2 << 8 ; i1 = i1 | i2 ; result . append ( ( char ) i1 ) ; } return ( result . toString ( ) ) ; }
Converts a double byte array to a string .
39,173
public static String stackToDebugString ( Throwable e ) { StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; e . printStackTrace ( pw ) ; pw . close ( ) ; String text = sw . toString ( ) ; text = text . substring ( text . indexOf ( "at" ) ) ; return text ; }
Get a string containing the stack of the specified exception
39,174
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public static String setPropertyAsNeeded ( final String propName , final String propValue ) { String previousPropValue = ( String ) java . security . AccessController . doPrivileged ( new java . security . PrivilegedAction ( ) { public String run ( ) { String oldPropValue = System . getProperty ( propName ) ; if ( propValue == null ) { System . clearProperty ( propName ) ; } else if ( ! propValue . equalsIgnoreCase ( oldPropValue ) ) { System . setProperty ( propName , propValue ) ; } return oldPropValue ; } } ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , propName + " property previous: " + ( ( previousPropValue != null ) ? previousPropValue : "<null>" ) + " and now: " + propValue ) ; return previousPropValue ; }
This method set the system property if the property is null or property value is not the same with the new value
39,175
public static void restorePropertyAsNeeded ( final String propName , final String oldPropValue , final String newPropValue ) { java . security . AccessController . doPrivileged ( new java . security . PrivilegedAction < Object > ( ) { public Object run ( ) { if ( oldPropValue == null ) { System . clearProperty ( propName ) ; } else if ( ! oldPropValue . equalsIgnoreCase ( newPropValue ) ) { System . setProperty ( propName , oldPropValue ) ; } return null ; } } ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Restore property " + propName + " to previous value: " + oldPropValue ) ; }
This method restore the property value to the original value .
39,176
protected void setSharedConnection ( Object affinity , MCWrapper mcWrapper ) { final boolean isTracingEnabled = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTracingEnabled && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "setSharedConnection" ) ; } mcWrapper . setSharedPoolCoordinator ( affinity ) ; mcWrapper . setSharedPool ( this ) ; synchronized ( sharedLockObject ) { mcWrapperList [ mcWrapperListSize ] = mcWrapper ; mcWrapper . setPoolState ( 2 ) ; ++ mcWrapperListSize ; if ( mcWrapperListSize >= objectArraySize ) { objectArraySize = objectArraySize * 2 ; mcWrapperListTemp = new MCWrapper [ objectArraySize ] ; System . arraycopy ( mcWrapperList , 0 , mcWrapperListTemp , 0 , mcWrapperList . length ) ; mcWrapperList = mcWrapperListTemp ; } } if ( isTracingEnabled && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "setSharedConnection" ) ; } }
Adds a shared connection to the list
39,177
protected void removeSharedConnection ( MCWrapper mcWrapper ) throws ResourceException { final boolean isTracingEnabled = TraceComponent . isAnyTracingEnabled ( ) ; boolean removedSharedConnection = false ; if ( isTracingEnabled && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "removeSharedConnection" ) ; } synchronized ( sharedLockObject ) { if ( mcWrapperListSize == 1 ) { if ( mcWrapper == mcWrapperList [ 0 ] ) { removedSharedConnection = true ; mcWrapperListSize = 0 ; mcWrapperList [ mcWrapperListSize ] = null ; } } else { for ( int i = 0 ; i < mcWrapperListSize ; ++ i ) { if ( removedSharedConnection ) { mcWrapperList [ i - 1 ] = mcWrapperList [ -- mcWrapperListSize ] ; mcWrapperList [ mcWrapperListSize ] = null ; break ; } else { if ( mcWrapper == mcWrapperList [ i ] ) { removedSharedConnection = true ; if ( i == mcWrapperListSize ) { mcWrapperList [ -- mcWrapperListSize ] = null ; } } } } } } if ( ! removedSharedConnection ) { Tr . error ( tc , "SHAREDPOOL_REMOVESHAREDCONNECTION_ERROR_J2CA1003" , mcWrapper ) ; ResourceException re = new ResourceException ( "removeSharedConnection: failed to remove MCWrapper " + mcWrapper . toString ( ) ) ; com . ibm . ws . ffdc . FFDCFilter . processException ( re , "com.ibm.ejs.j2c.poolmanager.SharedPool.removeSharedConnection" , "184" , this ) ; _pm . activeRequest . decrementAndGet ( ) ; throw re ; } else { mcWrapper . setPoolState ( 0 ) ; } if ( isTracingEnabled && tc . isEntryEnabled ( ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Removed connection" ) ; } Tr . exit ( this , tc , "removeSharedConnection" ) ; } }
Remove a shared connection from the list
39,178
public void setDelegatedUsers ( ArrayList < String > delegatedUsers ) { AuditThreadContext auditThreadContext = getAuditThreadContext ( ) ; auditThreadContext . setDelegatedUsers ( delegatedUsers ) ; }
Sets the list of users from the initial caller through the last caller in a runAs delegation call
39,179
public void setProvider ( Object pObj ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setProvider pre: pObj(class)=" + pObj . getClass ( ) + " isProxy=" + Proxy . isProxyClass ( pObj . getClass ( ) ) + " provider=" + ( provider == null ? "null" : provider . getClass ( ) ) + " oldProvider=" + ( oldProvider == null ? "null" : oldProvider . getClass ( ) ) ) ; } this . oldProvider = this . provider ; this . provider = ( T ) pObj ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setProvider post: provider=" + ( provider == null ? "null" : provider . getClass ( ) ) + " oldProvider=" + ( oldProvider == null ? "null" : oldProvider . getClass ( ) ) ) ; } }
we need use this interface to replace the provider object
39,180
protected JsonObject readJsonFromContent ( Object contentToValidate ) throws Exception { if ( contentToValidate == null ) { throw new Exception ( "Provided content is null so cannot be validated." ) ; } JsonObject obj = null ; try { String responseText = WebResponseUtils . getResponseText ( contentToValidate ) ; obj = Json . createReader ( new StringReader ( responseText ) ) . readObject ( ) ; } catch ( Exception e ) { throw new Exception ( "Failed to read JSON data from the provided content. The exception was [" + e + "]. The content to validate was: [" + contentToValidate + "]." ) ; } return obj ; }
Attempts to read the response text in the provided object as a JSON string and convert it to its corresponding JsonObject representation . Extending classes should override this method if they do not expect the content to be a pure JSON string . For example if the provided object is an instance of WebResponse whose response text includes other non - JSON information the extending expectation class should override this method to extract the appropriate JSON data .
39,181
private void init ( int max ) { if ( ( max != INTERNAL ) && ( max != PROVIDER ) && ( max != PRIVILEGED ) ) throw new IllegalArgumentException ( "invalid action" ) ; if ( max == NONE ) throw new IllegalArgumentException ( "missing action" ) ; if ( getName ( ) == null ) throw new NullPointerException ( "action can't be null" ) ; this . max = max ; }
initialize a WebSphereSecurityPermission object . Common to all constructors .
39,182
private static int getMax ( String action ) { int max = NONE ; if ( action == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "WebSphereSecurityPermission action should not be null" ) ; } return max ; } if ( INTERNAL_STR . equalsIgnoreCase ( action ) ) { max = INTERNAL ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "WebSphereSecurityPermission - internal" ) ; } } else if ( PROVIDER_STR . equalsIgnoreCase ( action ) ) { max = PROVIDER ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "WebSphereSecurityPermission - provider" ) ; } } else if ( PRIVILEGED_STR . equalsIgnoreCase ( action ) ) { max = PRIVILEGED ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "WebSphereSecurityPermission - privileged" ) ; } } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "WebSphereSecurityPermission invalid action " + action ) ; } throw new IllegalArgumentException ( "invalid permission: " + action ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "WebSphereSecurityPermission value = " + max ) ; } return max ; }
Converts an action String to a permission value .
39,183
public void removeAll ( Transaction tran ) throws MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeAll" , tran ) ; while ( this . removeFirstMatching ( null , tran ) != null ) ; remove ( tran , NO_LOCK_ID ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeAll" ) ; }
Removes all items from this reference stream
39,184
protected final void setStorageStrategy ( int setStrategy ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setStorageStrategy" , new Integer ( setStrategy ) ) ; storageStrategy = setStrategy ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setStorageStrategy" ) ; }
Set the storage strategy of this stream . Needs to be called before the stream is actually stored .
39,185
public int getPersistentVersion ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getPersistentVersion" ) ; SibTr . exit ( tc , "getPersistentVersion" , new Integer ( DEFAULT_PERSISTENT_VERSION ) ) ; } return DEFAULT_PERSISTENT_VERSION ; }
Return the class version number when the MessageStore wants to persist the object . Each class will have its own version number . Any time the data persisted is changed this version will have to be incremented so that the restore routine can distinguish between old and new objects and act accordingly .
39,186
public void addUnrestoredMsgId ( long msgId ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addUnrestoredMsgId" , new Long ( msgId ) ) ; unrestoredMsgIds . add ( new Long ( msgId ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addUnrestoredMsgId" ) ; }
Adds a msgId to the list of uninitialised msg references
39,187
public Collection clearUnrestoredMessages ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "clearUnrestoredMessages" ) ; Collection returnCollection = unrestoredMsgIds ; unrestoredMsgIds = new ArrayList ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "clearUnrestoredMessages" , returnCollection ) ; return returnCollection ; }
Returns a reference to the list of unrestored messages and nullifies the internal reference for subsequent garbage collection .
39,188
public void setBinding ( String binding ) throws JspException { if ( ! isValueReference ( binding ) ) { throw new IllegalArgumentException ( "not a valid binding: " + binding ) ; } _binding = binding ; }
Setter for common JSF xml attribute binding .
39,189
public static UIComponentTag getParentUIComponentTag ( PageContext pageContext ) { UIComponentClassicTagBase parentTag = getParentUIComponentClassicTagBase ( pageContext ) ; return parentTag instanceof UIComponentTag ? ( UIComponentTag ) parentTag : new UIComponentTagWrapper ( parentTag ) ; }
Return the nearest JSF tag that encloses this tag .
39,190
protected UIComponent createComponent ( FacesContext context , String id ) { String componentType = getComponentType ( ) ; if ( componentType == null ) { throw new NullPointerException ( "componentType" ) ; } if ( _binding != null ) { Application application = context . getApplication ( ) ; ValueBinding componentBinding = application . createValueBinding ( _binding ) ; UIComponent component = application . createComponent ( componentBinding , context , componentType ) ; component . setId ( id ) ; component . setValueBinding ( "binding" , componentBinding ) ; setProperties ( component ) ; return component ; } UIComponent component = context . getApplication ( ) . createComponent ( componentType ) ; component . setId ( id ) ; setProperties ( component ) ; return component ; }
Create a UIComponent . Abstract method getComponentType is invoked to determine the actual type name for the component to be created .
39,191
protected boolean isSuppressed ( ) { if ( _suppressed == null ) { if ( isFacet ( ) ) { _suppressed = Boolean . TRUE ; return true ; } UIComponent component = getComponentInstance ( ) ; UIComponent parent = component . getParent ( ) ; while ( parent != null ) { if ( parent . getRendersChildren ( ) ) { _suppressed = Boolean . TRUE ; return true ; } parent = parent . getParent ( ) ; } while ( component != null ) { if ( ! component . isRendered ( ) ) { _suppressed = Boolean . TRUE ; return true ; } component = component . getParent ( ) ; } _suppressed = Boolean . FALSE ; } return _suppressed . booleanValue ( ) ; }
Determine whether this component renders itself . A component is suppressed when it is either not rendered or when it is rendered by its parent component at a time of the parent s choosing .
39,192
public void setData ( List < DataSlice > dataSlices ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setData" , "DataSlices=" + dataSlices ) ; _dataSlices = dataSlices ; _estimatedLength = - 1 ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setData" ) ; }
static initializer .
39,193
@ JSFProperty ( deferredValueType = "java.lang.Object" ) public Locale getLocale ( ) { if ( _locale != null ) { return _locale ; } FacesContext context = FacesContext . getCurrentInstance ( ) ; return context . getViewRoot ( ) . getLocale ( ) ; }
The name of the locale to be used instead of the default as specified in the faces configuration file .
39,194
public static void useProvider ( String className , String handlerName ) { _httpsProviderClass = null ; JSSE_PROVIDER_CLASS = className ; SSL_PROTOCOL_HANDLER = handlerName ; }
use the given SSL providers - reset the one used so far
39,195
public static Class getHttpsProviderClass ( ) throws ClassNotFoundException { if ( _httpsProviderClass == null ) { Provider [ ] sslProviders = Security . getProviders ( "SSLContext.SSLv3" ) ; if ( sslProviders != null && sslProviders . length > 0 ) { _httpsProviderClass = sslProviders [ 0 ] . getClass ( ) ; } if ( _httpsProviderClass == null ) { sslProviders = Security . getProviders ( "SSLContext.TLS" ) ; if ( sslProviders != null && sslProviders . length > 0 ) { _httpsProviderClass = sslProviders [ 0 ] . getClass ( ) ; } } if ( _httpsProviderClass == null ) { _httpsProviderClass = Class . forName ( JSSE_PROVIDER_CLASS ) ; } } return _httpsProviderClass ; }
get the Https Provider Class if it s been set already return it - otherwise check with the Security package and take the first available provider if all fails take the default provider class
39,196
private static void registerSSLProtocolHandler ( ) { String list = System . getProperty ( PROTOCOL_HANDLER_PKGS ) ; if ( list == null || list . length ( ) == 0 ) { System . setProperty ( PROTOCOL_HANDLER_PKGS , SSL_PROTOCOL_HANDLER ) ; } else if ( list . indexOf ( SSL_PROTOCOL_HANDLER ) < 0 ) { System . setProperty ( PROTOCOL_HANDLER_PKGS , list + " | " + SSL_PROTOCOL_HANDLER ) ; } }
register the Secure Socket Layer Protocol Handler
39,197
protected static int obtainIntConfigParameter ( MessageStoreImpl msi , String parameterName , String defaultValue , int minValue , int maxValue ) { int value = Integer . parseInt ( defaultValue ) ; if ( msi != null ) { String strValue = msi . getProperty ( parameterName , defaultValue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , parameterName + "=" + strValue ) ; } ; try { value = Integer . parseInt ( strValue ) ; if ( ( value < minValue ) || ( value > maxValue ) ) { value = Integer . parseInt ( defaultValue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "OVERRIDE: " + parameterName + "=" + strValue ) ; } ; } ; } catch ( NumberFormatException nfexc ) { } } ; return value ; }
Obtains the value of an integer configuration parameter given its name the default value and reasonable minimum and maximum values .
39,198
protected static long obtainLongConfigParameter ( MessageStoreImpl msi , String parameterName , String defaultValue , long minValue , long maxValue ) { long value = Long . parseLong ( defaultValue ) ; if ( msi != null ) { String strValue = msi . getProperty ( parameterName , defaultValue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , parameterName + "=" + strValue ) ; } ; try { value = Long . parseLong ( strValue ) ; if ( ( value < minValue ) || ( value > maxValue ) ) { value = Long . parseLong ( defaultValue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "OVERRIDE: " + parameterName + "=" + strValue ) ; } ; } ; } catch ( NumberFormatException nfexc ) { } } ; return value ; }
Obtains the value of a long integer configuration parameter given its name the default value and reasonable minimum and maximum values .
39,199
public int originalFrame ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . entry ( this , tc , "originalFrame" ) ; int result ; synchronized ( getMessageLockArtefact ( ) ) { if ( ( contents == null ) || reallocated ) { result = - 1 ; } else { result = length ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . exit ( this , tc , "originalFrame" , Integer . valueOf ( result ) ) ; return result ; }
only called by Unit Tests so it is academic .