idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
160,600
private synchronized void parseParameters ( ) { if ( null != this . queryParams ) { // already parsed return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "parseParameters for " + this ) ; } String encoding = getCharset ( ) . name ( ) ; // PQ99481... non-English environments are too complex at the moment due to // the fact that current clients are not enforcing the proper Content-Type // header usage therefore figuring out what encoding to use involves system // properties, WAS config files, etc. So query parameters will only be // pulled // from the URI and not POST formdata // now merge in any possible URL params String queryString = getQueryString ( ) ; if ( null != queryString ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Parsing URL query data" ) ; } this . queryParams = HttpChannelUtils . parseQueryString ( queryString , encoding ) ; } else { // if we didn't have any data then just create an empty table if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { // PQ99481 Tr.debug(tc, "No parameter data found in body or URL"); Tr . debug ( tc , "No query data found in URL" ) ; } this . queryParams = new Hashtable < String , String [ ] > ( ) ; } }
Parse the query parameters out of this message . This will check just the URL query data of the request .
332
22
160,601
protected void setDataSourceFactory ( ServiceReference < ResourceFactory > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setDataSourceFactory" , "setting " + ref ) ; } dataSourceFactoryRef . setReference ( ref ) ; }
Declarative Services method for setting the data source service reference
108
12
160,602
protected void unsetDataSourceFactory ( ServiceReference < ResourceFactory > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetDataSourceFactory" , "unsetting " + ref ) ; } dataSourceFactoryRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the data source service reference
112
13
160,603
protected void setResourceConfigFactory ( ServiceReference < ResourceConfigFactory > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setResourceConfigFactory" , "setting " + ref ) ; } resourceConfigFactoryRef . setReference ( ref ) ; }
Declarative Services method for setting the ResourceConfigFactory service reference
109
13
160,604
protected void unsetResourceConfigFactory ( ServiceReference < ResourceConfigFactory > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetResourceConfigFactory" , "unsetting " + ref ) ; } resourceConfigFactoryRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the ResourceConfigFactory service reference
113
14
160,605
protected void setLocalTransactionCurrent ( ServiceReference < LocalTransactionCurrent > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setLocalTransactionCurrent" , "setting " + ref ) ; } localTransactionCurrentRef . setReference ( ref ) ; }
Declarative Services method for setting the LocalTransactionCurrent service reference
109
13
160,606
protected void unsetLocalTransactionCurrent ( ServiceReference < LocalTransactionCurrent > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetLocalTransactionCurrent" , "unsetting " + ref ) ; } localTransactionCurrentRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the LocalTransactionCurrent service reference
113
14
160,607
protected void setEmbeddableWebSphereTransactionManager ( ServiceReference < EmbeddableWebSphereTransactionManager > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setEmbeddableWebSphereTransactionManager" , "setting " + ref ) ; } embeddableWebSphereTransactionManagerRef . setReference ( ref ) ; }
Declarative Services method for setting the EmbeddableWebSphereTransactionManager service reference
125
17
160,608
protected void unsetEmbeddableWebSphereTransactionManager ( ServiceReference < EmbeddableWebSphereTransactionManager > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetEmbeddableWebSphereTransactionManager" , "unsetting " + ref ) ; } embeddableWebSphereTransactionManagerRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the EmbeddableWebSphereTransactionManager service reference
129
18
160,609
protected void setUowCurrent ( ServiceReference < UOWCurrent > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setUowCurrent" , "setting " + ref ) ; } uowCurrentRef . setReference ( ref ) ; }
Declarative Services method for setting the UOWCurrent service reference
109
13
160,610
protected void unsetUowCurrent ( ServiceReference < UOWCurrent > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetUowCurrent" , "unsetting " + ref ) ; } uowCurrentRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the UOWCurrent service reference
113
14
160,611
protected void setUserTransaction ( ServiceReference < UserTransaction > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setUserTransaction" , "setting " + ref ) ; } userTransactionRef . setReference ( ref ) ; }
Declarative Services method for setting the UserTransaction service reference
105
12
160,612
protected void unsetUserTransaction ( ServiceReference < UserTransaction > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetUserTransaction" , "unsetting " + ref ) ; } userTransactionRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the UserTransaction service reference
109
13
160,613
protected void setSerializationService ( ServiceReference < SerializationService > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setSerializationService" , "setting " + ref ) ; } serializationServiceRef . setReference ( ref ) ; }
Declarative Services method for setting the SerializationService service reference
109
13
160,614
protected void unsetSerializationService ( ServiceReference < SerializationService > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "unsetSerializationService" , "unsetting " + ref ) ; } serializationServiceRef . unsetReference ( ref ) ; }
Declarative Services method for unsetting the SerializationService service reference
113
14
160,615
private Connection getJdbcConnection ( ) throws JspCoreException , SQLException { Connection conn = null ; String url = getConnProperties ( ) . getUrl ( ) ; String user = getConnProperties ( ) . getLoginUser ( ) ; String passwd = getConnProperties ( ) . getLoginPasswd ( ) ; String jndiName = getConnProperties ( ) . getJndiName ( ) ; //System.out.println("***** Query.getJdbcConnection(): jndiname = " + jndiName); if ( jndiName == null ) { // use driver manager // load driver String dbDriver = ( getConnProperties ( ) ) . getDbDriver ( ) ; try { Class . forName ( dbDriver ) ; conn = DriverManager . getConnection ( url , user , passwd ) ; } // try load driver catch ( ClassNotFoundException e ) { //com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.webcontainer.jsp.tsx.db.Query.getJdbcConnection", "174", this); throw new JspCoreException ( JspConstants . InvalidDbDriver + dbDriver ) ; } // catch } // if jndiname == null else { // use datasource DataSource ds ; try { ds = getSingleton ( jndiName ) ; } catch ( Throwable th ) { //com.ibm.ws.ffdc.FFDCFilter.processException(th, "com.ibm.ws.webcontainer.jsp.tsx.db.Query.getJdbcConnection", "184", this); throw new JspCoreException ( JspConstants . DatasourceException + th . getMessage ( ) ) ; } conn = ds . getConnection ( user , passwd ) ; } return conn ; }
Return a valid jdbc connection . if jndiName is specified then assume that we need to use a datasource else use a drivermanager
415
30
160,616
public static boolean isAbsolutePath ( String uri ) { boolean absolute = false ; if ( uri != null ) { if ( uri . indexOf ( ":/" ) != - 1 ) { absolute = true ; } else if ( uri . indexOf ( ":\\" ) != - 1 ) { absolute = true ; } } return absolute ; }
Checks to see if URI is absolute or relative .
77
11
160,617
private static boolean equalsHashes ( File fileToHash , String hashToCompare ) throws IOException { boolean result = false ; // Now calculate the new hash and compare the 2. If they are NOT the same the ifix needs to be re-applied. String fileHash = MD5Utils . getFileMD5String ( fileToHash ) ; if ( fileHash . equals ( hashToCompare ) ) result = true ; return result ; }
This method calculates a hash of the required file and compares it against the supplied hash . It then returns true if both hashes are equals .
94
27
160,618
private static Map < String , IFixInfo > processIFixXmls ( File wlpInstallationDirectory , Map < String , BundleFile > bundleFiles , CommandConsole console ) { // A map of update file names and the IfixInfo objects that contain the latest versions of these files. Map < String , IFixInfo > filteredIfixInfos = new HashMap < String , IFixInfo > ( ) ; // A map of updated file names and the UpdateFile Object that represents the latest version of the file. // We use this map so that we don't have to find the file in the ifix info object each time. Map < String , UpdatedFile > latestIfixFiles = new HashMap < String , UpdatedFile > ( ) ; // Get the full list of XML files Set < IFixInfo > ifixInfos = getInstalledIFixes ( wlpInstallationDirectory , console ) ; // Iterate over each one and process each file. for ( IFixInfo chkinfo : ifixInfos ) { // For each ifix, list all of the updated files for ( UpdatedFile updateFile : chkinfo . getUpdates ( ) . getFiles ( ) ) { // See if we have an existing entry in the map of existing files. If not, add this one to the map, otherwise // check to see if this file has a more recent date than the one stored. If it does, then // replace the existing one with this new entry. String existingUpdateFileID ; String updateId = updateFile . getId ( ) ; // If we have a jar file, then we need to find the existing id which won't be the same as our current one, because the ifix qualifiers are // different for each ifix jar. if ( bundleFiles . containsKey ( updateId ) ) { existingUpdateFileID = getExistingMatchingIfixID ( bundleFiles . get ( updateId ) , latestIfixFiles . keySet ( ) , bundleFiles ) ; } else { // If we're not a jar but a static file, then use the updateID to find the existing values. existingUpdateFileID = updateId ; } // If we've got an existing entry and the date of the currently processed updateFile has a greater date, // then remove the old version and replace it with the new one. UpdatedFile existingUpdateFile = latestIfixFiles . get ( existingUpdateFileID ) ; if ( existingUpdateFile != null ) { int dateComparison = updateFile . getDate ( ) . compareTo ( existingUpdateFile . getDate ( ) ) ; boolean replaceInMap = false ; if ( dateComparison > 0 ) replaceInMap = true ; else if ( dateComparison == 0 ) { //the same file had the same date in two fixes //check the number of problems being resolved IFixInfo existingFixInfo = filteredIfixInfos . get ( existingUpdateFileID ) ; List < Problem > existingProblems = existingFixInfo . getResolves ( ) . getProblems ( ) ; List < Problem > problems = chkinfo . getResolves ( ) . getProblems ( ) ; //since fixes are cumulative, whichever resolves more problems is newer if ( existingProblems . size ( ) < problems . size ( ) ) replaceInMap = true ; } if ( replaceInMap ) { filteredIfixInfos . remove ( existingUpdateFileID ) ; latestIfixFiles . remove ( existingUpdateFileID ) ; filteredIfixInfos . put ( updateId , chkinfo ) ; latestIfixFiles . put ( updateId , updateFile ) ; } } else { // If we don't have an existing entry, add this new entry. filteredIfixInfos . put ( updateId , chkinfo ) ; latestIfixFiles . put ( updateId , updateFile ) ; } } } return filteredIfixInfos ; }
This method processes all of the ifix xml s and stores the latest version of each file found in a map . The comparisons on each file are based on the date associated with the file . The latest date means the latest update .
819
46
160,619
private static String getExistingMatchingIfixID ( BundleFile bundleFile , Set < String > existingIDs , Map < String , BundleFile > bundleFiles ) { String existingIfixKey = null ; // Iterate over the known ids. for ( String existingID : existingIDs ) { // If we have a corresponding BundleFile for the existing ID, we need to check it matches the currently processed file. if ( bundleFiles . containsKey ( existingID ) ) { BundleFile existingBundleFile = bundleFiles . get ( existingID ) ; // If our symbolic name match the supplied BundleFile then move on to the version checking. if ( bundleFile . getSymbolicName ( ) . equals ( existingBundleFile . getSymbolicName ( ) ) ) { //Get the versions of both the checking bundle and the existing bundle. Check that the version, excluding the qualifier match // and if they do, we have a match. Version existingBundleVersion = new Version ( existingBundleFile . getVersion ( ) ) ; Version bundleVersion = new Version ( bundleFile . getVersion ( ) ) ; if ( bundleVersion . getMajor ( ) == existingBundleVersion . getMajor ( ) && bundleVersion . getMinor ( ) == existingBundleVersion . getMinor ( ) && bundleVersion . getMicro ( ) == existingBundleVersion . getMicro ( ) ) existingIfixKey = existingID ; } } } return existingIfixKey ; }
This method takes a ifix ID finds any existing IFix IDs that refer to the same base bundle . Because the ifix jars will have different qualifiers we need to be able to work out which ids are related .
307
44
160,620
private static Map < String , BundleFile > processLPMFXmls ( File wlpInstallationDirectory , CommandConsole console ) { // A map of update file names and the IfixInfo objects that contain the latest versions of these files. Map < String , BundleFile > bundleFiles = new HashMap < String , BundleFile > ( ) ; // Iterate over each Liberty Profile Metadata file and process each bundle. for ( LibertyProfileMetadataFile chklpmf : getInstalledLibertyProfileMetadataFiles ( wlpInstallationDirectory , console ) ) { // For each metadata file, list all of the bundle files Bundles bundles = chklpmf . getBundles ( ) ; if ( bundles != null ) { List < BundleFile > bundleEntries = bundles . getBundleFiles ( ) ; if ( bundleEntries != null ) { for ( BundleFile bundleFile : bundleEntries ) { // See if we have an existing entry in the map of existing files. If not, add this one to the map, otherwise // check to see if this file has a more recent date than the one stored. If it does, then // replace the existing one with this new entry. bundleFiles . put ( bundleFile . getId ( ) , bundleFile ) ; } } } } return bundleFiles ; }
This method processes all of the Liberty profile Metadata files stores the BundleFile objects containing the BundleSymbolic name and version of each bundle against the id of the file that matches the corresponding entry in the ifix . xml .
275
46
160,621
public static String getEntityType ( String accessId ) { Matcher m = matcher ( accessId ) ; if ( m != null ) { return m . group ( 1 ) ; } return null ; }
Given an accessId extract the entity type .
43
9
160,622
public static String getRealm ( String accessId ) { Matcher m = matcher ( accessId ) ; if ( m != null ) { return m . group ( 2 ) ; } return null ; }
Given an accessId extract the realm .
43
8
160,623
public static String getUniqueId ( String accessId ) { Matcher m = matcher ( accessId ) ; if ( m != null ) { return m . group ( 3 ) ; } return null ; }
Given an accessId extract the uniqueId .
43
9
160,624
public static String getUniqueId ( String accessId , String realm ) { if ( realm != null ) { Pattern pattern = Pattern . compile ( "([^:]+):(" + Pattern . quote ( realm ) + ")/(.*)" ) ; Matcher m = pattern . matcher ( accessId ) ; if ( m . matches ( ) ) { if ( m . group ( 3 ) . length ( ) > 0 ) { return m . group ( 3 ) ; } } } // if there is no match, fall back. return getUniqueId ( accessId ) ; }
Given an accessId and realm name extract the uniqueId .
120
12
160,625
private String replaceNonAlpha ( String name ) { String modifiedName = null ; if ( p != null ) modifiedName = p . matcher ( name ) . replaceAll ( "_" ) ; return modifiedName ; }
Replace non - alphanumeric characters in a string with underscores .
45
14
160,626
public void setConsumerDispatcher ( ConsumerDispatcher consumerDispatcher ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setConsumerDispatcher" , consumerDispatcher ) ; this . consumerDispatcher = consumerDispatcher ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setConsumerDispatcher" ) ; }
Set the consumerDispatcher object to which this itemstream belongs
112
13
160,627
@ Override public void xmlWriteOn ( FormattedWriter writer ) throws IOException { if ( consumerDispatcher != null ) { writer . newLine ( ) ; writer . taggedValue ( "consumerDispatcher" , consumerDispatcher . toString ( ) ) ; } }
Prints debug information to the XML writer
60
8
160,628
public void markAsToBeDeleted ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "markAsToBeDeleted" ) ; toBeDeleted = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "markAsToBeDeleted" ) ; }
Mark this itemstream as awaiting deletion
97
7
160,629
public LockManager getSubscriptionLockManager ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getSubscriptionLockManager" ) ; SibTr . exit ( tc , "getSubscriptionLockManager" , _subscriptionLockManager ) ; } return _subscriptionLockManager ; }
Returns the lock manager associated with this subscription
82
8
160,630
@ Trivial private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { GetField fields = in . readFields ( ) ; failure = ( Throwable ) fields . get ( FAILURE , null ) ; previousResult = ( byte [ ] ) fields . get ( PREVIOUS_RESULT , null ) ; }
Deserialize information about the skipped execution .
75
9
160,631
@ Trivial private void writeObject ( ObjectOutputStream out ) throws IOException { PutField fields = out . putFields ( ) ; fields . put ( FAILURE , failure ) ; fields . put ( PREVIOUS_RESULT , previousResult ) ; out . writeFields ( ) ; }
Serialize information about the skipped execution .
65
8
160,632
public static < T > StaticValue < T > mutateStaticValue ( StaticValue < T > staticValue , Callable < T > initializer ) { if ( multiplex ) { // Multiplexing case; must check for existing StaticValue if ( staticValue == null ) { // no existing value; create new one with no constructor initializer staticValue = StaticValue . createStaticValue ( null ) ; } // initialize this thread only with the initializer staticValue . initialize ( getThreadGroup ( ) , initializer ) ; return staticValue ; } // Final singleton case; just create a new StaticValue return StaticValue . createStaticValue ( initializer ) ; }
Mutates a static value . Note that if not multiplexing then this method returns a new StaticValue object with the value as obtained by the initializer .
139
32
160,633
public static Object concat ( Object [ ] arrs ) { int totalLen = 0 ; Class commonComponentType = null ; for ( int i = 0 , len = arrs . length ; i < len ; i ++ ) { // skip all null arrays if ( arrs [ i ] == null ) { continue ; } int arrayLen = Array . getLength ( arrs [ i ] ) ; // skip all empty arrays if ( arrayLen == 0 ) { continue ; } totalLen += arrayLen ; Class componentType = arrs [ i ] . getClass ( ) . getComponentType ( ) ; commonComponentType = ( commonComponentType == null ) ? componentType : commonClass ( commonComponentType , componentType ) ; } if ( commonComponentType == null ) { return null ; } return concat ( Array . newInstance ( commonComponentType , totalLen ) , totalLen , arrs ) ; }
Concatenates arrays into one . Any null or empty arrays are ignored . If all arrays are null or empty returns null . Elements will be ordered in the order in which the arrays are supplied .
191
40
160,634
@ Override public int compare ( T entity1 , T entity2 ) { SortHandler shandler = new SortHandler ( sortControl ) ; return shandler . compareEntitysWithRespectToProperties ( ( Entity ) entity1 , ( Entity ) entity2 ) ; }
Compares its two objects for order . Returns a negative integer zero or a positive integer as the first argument is less than equal to or greater than the second .
59
32
160,635
public void dump ( ) { if ( ! tc . isDumpEnabled ( ) ) { return ; } Enumeration vEnum = lockTable . keys ( ) ; Tr . dump ( tc , "-- Lock Manager Dump --" ) ; while ( vEnum . hasMoreElements ( ) ) { Object key = vEnum . nextElement ( ) ; Tr . dump ( tc , "lock table entry" , new Object [ ] { key , lockTable . get ( key ) } ) ; } }
Dump internal state of lock manager .
109
8
160,636
protected Commandline getCommandline ( ) { Commandline cmdl = new Commandline ( ) ; if ( configFile != null ) { cmdl . createArgument ( ) . setValue ( "--config" ) ; cmdl . createArgument ( ) . setFile ( configFile ) ; } if ( debug ) { cmdl . createArgument ( ) . setValue ( "--debug" ) ; } return cmdl ; }
Get the command line configuration arguments for the StaticTraceInstrumentation invocations .
92
17
160,637
@ Override public void execute ( ) { List < File > flist = new ArrayList < File > ( ) ; if ( file != null ) { flist . add ( file ) ; } for ( int i = 0 ; i < filesets . size ( ) ; i ++ ) { FileSet fs = filesets . elementAt ( i ) ; DirectoryScanner ds = fs . getDirectoryScanner ( getProject ( ) ) ; File dir = fs . getDir ( getProject ( ) ) ; String [ ] includedFiles = ds . getIncludedFiles ( ) ; for ( String s : Arrays . asList ( includedFiles ) ) { flist . add ( new File ( dir , s ) ) ; } } Commandline cmdl = getCommandline ( ) ; for ( File f : flist ) { cmdl . createArgument ( ) . setFile ( f ) ; } AbstractInstrumentation inst ; try { inst = createInstrumentation ( ) ; if ( cmdl . size ( ) == 0 ) { return ; } inst . processArguments ( cmdl . getArguments ( ) ) ; inst . processPackageInfo ( ) ; } catch ( Exception t ) { getProject ( ) . log ( this , "Invalid class files or jars specified " + t , Project . MSG_ERR ) ; if ( failOnError ) { getProject ( ) . log ( "Instrumentation Failed" , t , Project . MSG_ERR ) ; throw new BuildException ( "InstrumentationFailed" , t ) ; } else { return ; } } List < File > classFiles = inst . getClassFiles ( ) ; List < File > jarFiles = inst . getJarFiles ( ) ; // I don't remember why I did this // inst.setClassFiles(null); // inst.setJarFiles(null); boolean instrumentationErrors = false ; for ( File f : classFiles ) { try { log ( "Instrumenting class " + f , verbosity ) ; inst . instrumentClassFile ( f ) ; } catch ( Throwable t ) { boolean instrumentationError = t instanceof InstrumentationException ; if ( failOnError && ! instrumentationError ) { throw new BuildException ( "Instrumentation of class " + f + " failed" , t ) ; } else { String reason = "" ; if ( instrumentationError ) { reason = ": " + t . getMessage ( ) ; instrumentationErrors = true ; } getProject ( ) . log ( this , "Unable to instrument class " + f + reason , Project . MSG_WARN ) ; } } } for ( File f : jarFiles ) { try { log ( "Instrumenting archive file " + f , verbosity ) ; inst . instrumentZipFile ( f ) ; } catch ( Throwable t ) { if ( failOnError ) { throw new BuildException ( "InstrumentationFailed" , t ) ; } else { getProject ( ) . log ( this , "Unable to instrument archive " + f , Project . MSG_WARN ) ; } } } if ( instrumentationErrors ) { throw new BuildException ( "Instrumentation of classes failed" ) ; } }
Execute the build task .
681
6
160,638
private ReturnCode write ( String command , ReturnCode notStartedRC , ReturnCode errorRC ) { SocketChannel channel = null ; try { ServerCommandID commandID = createServerCommand ( command ) ; if ( commandID . getPort ( ) > 0 ) { channel = SelectorProvider . provider ( ) . openSocketChannel ( ) ; channel . connect ( new InetSocketAddress ( InetAddress . getByName ( null ) , commandID . getPort ( ) ) ) ; // Write command. write ( channel , commandID . getCommandString ( ) ) ; // Receive authorization challenge. String authID = read ( channel ) ; // Respond to authorization challenge. File authFile = new File ( commandAuthDir , authID ) ; // Delete a file created by the server (check for write access) authFile . delete ( ) ; // respond to the server to indicate the delete has happened. write ( channel , authID ) ; // Read command response. String cmdResponse = read ( channel ) , targetServerUUID = null , responseCode = null ; if ( cmdResponse . isEmpty ( ) ) { throw new IOException ( "connection closed by server without a reply" ) ; } if ( cmdResponse . indexOf ( DELIM ) != - 1 ) { targetServerUUID = cmdResponse . substring ( 0 , cmdResponse . indexOf ( DELIM ) ) ; responseCode = cmdResponse . substring ( cmdResponse . indexOf ( DELIM ) + 1 ) ; } else { targetServerUUID = cmdResponse ; } if ( ! commandID . validateTarget ( targetServerUUID ) ) { throw new IOException ( "command file mismatch" ) ; } ReturnCode result = ReturnCode . OK ; if ( responseCode != null ) { try { int returnCode = Integer . parseInt ( responseCode . trim ( ) ) ; result = ReturnCode . getEnum ( returnCode ) ; } catch ( NumberFormatException nfe ) { throw new IOException ( "invalid return code" ) ; } } if ( result == ReturnCode . INVALID ) { throw new IOException ( "invalid return code" ) ; } return result ; } if ( commandID . getPort ( ) == - 1 ) { return ReturnCode . SERVER_COMMAND_PORT_DISABLED_STATUS ; } return notStartedRC ; } catch ( ConnectException e ) { Debug . printStackTrace ( e ) ; return notStartedRC ; } catch ( IOException e ) { Debug . printStackTrace ( e ) ; return errorRC ; } finally { Utils . tryToClose ( channel ) ; } }
Write a command to the server process .
560
8
160,639
public ReturnCode startStatus ( ServerLock lock ) { // The server process might not have created the command file yet. // Wait for it to appear. while ( ! isValid ( ) ) { ReturnCode rc = startStatusWait ( lock ) ; if ( rc != ReturnCode . START_STATUS_ACTION ) { return rc ; } } for ( int i = 0 ; i < BootstrapConstants . MAX_POLL_ATTEMPTS && isValid ( ) ; i ++ ) { // Try to connect to the server's command file. This might fail if // the command file is written but the server hasn't opened the // socket yet. ReturnCode rc = write ( STATUS_START_COMMAND , ReturnCode . START_STATUS_ACTION , ReturnCode . ERROR_SERVER_START ) ; if ( rc != ReturnCode . START_STATUS_ACTION ) { return rc ; } // Wait a bit, ensuring that the server process is still running. rc = startStatusWait ( lock ) ; if ( rc != ReturnCode . START_STATUS_ACTION ) { return rc ; } } return write ( STATUS_START_COMMAND , ReturnCode . ERROR_SERVER_START , ReturnCode . ERROR_SERVER_START ) ; }
Waits for the server to be fully started .
272
10
160,640
private ReturnCode startStatusWait ( ServerLock lock ) { try { Thread . sleep ( BootstrapConstants . POLL_INTERVAL_MS ) ; } catch ( InterruptedException ex ) { Debug . printStackTrace ( ex ) ; return ReturnCode . ERROR_SERVER_START ; } // This method is only called if the server process was holding // the server lock. If this process is suddenly able to obtain the // lock, then the server process didn't finish starting. if ( ! lock . testServerRunning ( ) ) { return ReturnCode . ERROR_SERVER_START ; } return ReturnCode . START_STATUS_ACTION ; }
Wait a bit because the server process could not be contacted and then verify that the server process is still running .
139
22
160,641
public ReturnCode stopServer ( boolean force ) { return write ( force ? FORCE_STOP_COMMAND : STOP_COMMAND , ReturnCode . REDUNDANT_ACTION_STATUS , ReturnCode . ERROR_SERVER_STOP ) ; }
Stop the server by issuing a stop instruction to the server listener
57
12
160,642
public ReturnCode introspectServer ( String dumpTimestamp , Set < JavaDumpAction > javaDumpActions ) { // Since "server dump" is used for diagnostics, we go out of our way to // not send an unrecognized command to the server even if the user has // broken their environment such that the client process supports java // dumps but the server doesn't. String command ; if ( javaDumpActions . isEmpty ( ) ) { command = INTROSPECT_COMMAND + DELIM + dumpTimestamp ; } else { StringBuilder commandBuilder = new StringBuilder ( ) . append ( INTROSPECT_JAVADUMP_COMMAND ) . append ( DELIM ) . append ( dumpTimestamp ) ; for ( JavaDumpAction javaDumpAction : javaDumpActions ) { commandBuilder . append ( ' ' ) . append ( javaDumpAction . name ( ) ) ; } command = commandBuilder . toString ( ) ; } return write ( command , ReturnCode . DUMP_ACTION , ReturnCode . ERROR_SERVER_DUMP ) ; }
Dump the server by issuing a introspect instruction to the server listener
235
14
160,643
public ReturnCode javaDump ( Set < JavaDumpAction > javaDumpActions ) { StringBuilder commandBuilder = new StringBuilder ( JAVADUMP_COMMAND ) ; char sep = DELIM ; for ( JavaDumpAction javaDumpAction : javaDumpActions ) { commandBuilder . append ( sep ) . append ( javaDumpAction . toString ( ) ) ; sep = ' ' ; } return write ( commandBuilder . toString ( ) , ReturnCode . SERVER_INACTIVE_STATUS , ReturnCode . ERROR_SERVER_DUMP ) ; }
Create a java dump of the server JVM by issuing a javadump instruction to the server listener
128
21
160,644
public ReturnCode pause ( String targetArg ) { StringBuilder commandBuilder = new StringBuilder ( PAUSE_COMMAND ) ; char sep = DELIM ; if ( targetArg != null ) { commandBuilder . append ( sep ) . append ( targetArg ) ; } return write ( commandBuilder . toString ( ) , ReturnCode . SERVER_INACTIVE_STATUS , ReturnCode . ERROR_SERVER_PAUSE ) ; }
Attempt to Stop the inbound work to a server by issuing a pause request to the server .
93
19
160,645
public ReturnCode resume ( String targetArg ) { StringBuilder commandBuilder = new StringBuilder ( RESUME_COMMAND ) ; char sep = DELIM ; if ( targetArg != null ) { commandBuilder . append ( sep ) . append ( targetArg ) ; } return write ( commandBuilder . toString ( ) , ReturnCode . SERVER_INACTIVE_STATUS , ReturnCode . ERROR_SERVER_RESUME ) ; }
Resume Inbound work to a server by issuing a resume request to the server .
93
17
160,646
public boolean contain ( OidcTokenImplBase token ) { //(IdToken token) { String key = token . getJwtId ( ) ; if ( key == null ) { return false ; } key = getCacheKey ( token ) ; long currentTimeMilliseconds = ( new Date ( ) ) . getTime ( ) ; synchronized ( primaryTable ) { Long exp = ( Long ) primaryTable . get ( key ) ; // milliseconds if ( exp != null ) { if ( exp . longValue ( ) > currentTimeMilliseconds ) { // not expired yet // milliseconds return true ; } else { primaryTable . remove ( key ) ; } } // cache the jwt long tokenExp = token . getExpirationTimeSeconds ( ) * 1000 ; // milliseconds if ( tokenExp == 0 ) { // in case it's not set, let's give it one hour tokenExp = currentTimeMilliseconds + 60 * 60 * 1000 ; // 1 hour } primaryTable . put ( key , Long . valueOf ( tokenExp ) ) ; } return false ; }
Find and return the object associated with the specified key . Add it if not already present .
225
18
160,647
public final ResourceException isValid ( int newAction ) { try { setState ( newAction , true ) ; } catch ( TransactionException exp ) { FFDCFilter . processException ( exp , "com.ibm.ws.rsadapter.spi.WSStateManager.isValid" , "385" , this ) ; return exp ; } return null ; }
If the action is valid return null . Otherwise return a TransactionException with the cause .
78
17
160,648
public boolean containsValue ( Object value ) throws ObjectManagerException { if ( getRoot ( ) != null ) return containsValue ( getRoot ( ) , value ) ; return false ; }
Searches this TreeMap for the specified value .
38
11
160,649
public Set entrySet ( ) throws ObjectManagerException { return new AbstractSetView ( ) { public long size ( ) { return size ; } public boolean contains ( Object object ) throws ObjectManagerException { if ( object instanceof Map . Entry ) { Map . Entry entry = ( Map . Entry ) object ; Object v1 = get ( entry . getKey ( ) ) , v2 = entry . getValue ( ) ; return v1 == null ? v2 == null : v1 . equals ( v2 ) ; } return false ; } public Iterator iterator ( ) throws ObjectManagerException { return makeTreeMapIterator ( new AbstractMapEntry . Type ( ) { public Object get ( AbstractMapEntry entry ) { return entry ; } } ) ; } } ; }
Answers a Set of the mappings contained in this TreeMap . Each element in the set is a Map . Entry . The set is backed by this TreeMap so changes to one are relected by the other . The set does not support adding .
159
51
160,650
public Object get ( Object key ) throws ObjectManagerException { Entry node = find ( key ) ; if ( node != null ) return node . value ; return null ; }
Answers the value of the mapping with the specified key .
35
12
160,651
public SortedMap headMap ( Object endKey ) { // Check for errors if ( comparator == null ) ( ( Comparable ) endKey ) . compareTo ( endKey ) ; else comparator . compare ( endKey , endKey ) ; return makeSubMap ( null , endKey ) ; }
Answers a SortedMap of the specified portion of this TreeMap which contains keys less than the end key . The returned SortedMap is backed by this TreeMap so changes to one are reflected by the other .
64
44
160,652
public Collection keyCollection ( ) { if ( keyCollection == null ) { keyCollection = new AbstractCollectionView ( ) { public long size ( ) throws ObjectManagerException { return AbstractTreeMap . this . size ( ) ; } public Iterator iterator ( ) throws ObjectManagerException { return makeTreeMapIterator ( new AbstractMapEntry . Type ( ) { public Object get ( AbstractMapEntry entry ) { return entry . key ; } } ) ; } } ; } return keyCollection ; }
Answers a Collection of the keys contained in this TreeMap . The set is backed by this TreeMap so changes to one are relected by the other . The Collection does not support adding .
101
39
160,653
public Object remove ( Object key ) throws ObjectManagerException { Entry node = find ( key ) ; if ( node == null ) return null ; Object result = node . value ; rbDelete ( node ) ; return result ; }
Removes a mapping with the specified key from this TreeMap .
47
13
160,654
public SortedMap subMap ( Object startKey , Object endKey ) { if ( comparator == null ) { if ( ( ( Comparable ) startKey ) . compareTo ( endKey ) <= 0 ) return makeSubMap ( startKey , endKey ) ; } else { if ( comparator . compare ( startKey , endKey ) <= 0 ) return makeSubMap ( startKey , endKey ) ; } throw new IllegalArgumentException ( ) ; }
Answers a SortedMap of the specified portion of this TreeMap which contains keys greater or equal to the start key but less than the end key . The returned SortedMap is backed by this TreeMap so changes to one are reflected by the other .
98
52
160,655
public SortedMap tailMap ( Object startKey ) { // Check for errors if ( comparator == null ) ( ( Comparable ) startKey ) . compareTo ( startKey ) ; else comparator . compare ( startKey , startKey ) ; return makeSubMap ( startKey , null ) ; }
Answers a SortedMap of the specified portion of this TreeMap which contains keys greater or equal to the start key . The returned SortedMap is backed by this TreeMap so changes to one are reflected by the other .
64
46
160,656
public Collection values ( ) { if ( values == null ) { values = new AbstractCollectionView ( ) { public long size ( ) throws ObjectManagerException { return AbstractTreeMap . this . size ( ) ; } public Iterator iterator ( ) throws ObjectManagerException { return makeTreeMapIterator ( new AbstractMapEntry . Type ( ) { public Object get ( AbstractMapEntry entry ) { return entry . getValue ( ) ; } } ) ; } } ; } return values ; }
Answers a Collection of the values contained in this TreeMap . The collection is backed by this TreeMap so changes to one are relected by the other . The collection does not support adding .
100
39
160,657
public static void assignMongoServers ( LibertyServer libertyServer ) throws Exception { MongoServerSelector mongoServerSelector = new MongoServerSelector ( libertyServer ) ; mongoServerSelector . updateLibertyServerMongos ( ) ; }
Reads a server configuration and replaces the placeholder values with an available host and port as specified in the mongo . properties file
54
25
160,658
private Map < String , List < MongoElement > > getMongoElements ( ) throws Exception { for ( MongoElement mongo : serverConfig . getMongos ( ) ) { addMongoElementToMap ( mongo ) ; } for ( MongoDBElement mongoDB : serverConfig . getMongoDBs ( ) ) { if ( mongoDB . getMongo ( ) != null ) { addMongoElementToMap ( mongoDB . getMongo ( ) ) ; } } return mongoElements ; }
Creates a mapping of a Mongo server placeholder value to the one or more mongo elements in the server . xml containing that placeholder
114
26
160,659
private void updateMongoElements ( String serverPlaceholder , ExternalTestService mongoService ) { Integer [ ] port = { Integer . valueOf ( mongoService . getPort ( ) ) } ; for ( MongoElement mongo : mongoElements . get ( serverPlaceholder ) ) { mongo . setHostNames ( mongoService . getAddress ( ) ) ; mongo . setPorts ( port ) ; String user = mongo . getUser ( ) ; if ( user != null ) { String replacementPassword = mongoService . getProperties ( ) . get ( user + "_password" ) ; if ( replacementPassword != null ) { mongo . setPassword ( replacementPassword ) ; } } } }
For the mongo elements containing the given placeholder value the host and port placeholder values in the mongo element are replaced with an actual host and port of an available mongo server .
153
36
160,660
private static boolean validateMongoConnection ( ExternalTestService mongoService ) { String method = "validateMongoConnection" ; MongoClient mongoClient = null ; String host = mongoService . getAddress ( ) ; int port = mongoService . getPort ( ) ; File trustStore = null ; MongoClientOptions . Builder optionsBuilder = new MongoClientOptions . Builder ( ) . connectTimeout ( 30000 ) ; try { trustStore = File . createTempFile ( "mongoTrustStore" , "jks" ) ; Map < String , String > serviceProperties = mongoService . getProperties ( ) ; String password = serviceProperties . get ( TEST_USERNAME + "_password" ) ; // will be null if there's no auth for this server SSLSocketFactory sslSocketFactory = null ; try { mongoService . writePropertyAsFile ( "ca_truststore" , trustStore ) ; sslSocketFactory = getSocketFactory ( trustStore ) ; } catch ( IllegalStateException e ) { // Ignore exception thrown if truststore is not present for this server // This indicates that we are not using SSL for this server and sslSocketFactory will be null } if ( sslSocketFactory != null ) { optionsBuilder . socketFactory ( sslSocketFactory ) ; } MongoClientOptions clientOptions = optionsBuilder . build ( ) ; List < MongoCredential > credentials = Collections . emptyList ( ) ; if ( password != null ) { MongoCredential credential = MongoCredential . createCredential ( TEST_USERNAME , TEST_DATABASE , password . toCharArray ( ) ) ; credentials = Collections . singletonList ( credential ) ; } Log . info ( c , method , "Attempting to contact server " + host + ":" + port + " with password " + ( password != null ? "set" : "not set" ) + " and truststore " + ( sslSocketFactory != null ? "set" : "not set" ) ) ; mongoClient = new MongoClient ( new ServerAddress ( host , port ) , credentials , clientOptions ) ; mongoClient . getDB ( "default" ) . getCollectionNames ( ) ; mongoClient . close ( ) ; } catch ( Exception e ) { Log . info ( c , method , "Couldn't create a connection to " + mongoService . getServiceName ( ) + " on " + mongoService . getAddress ( ) + ". " + e . toString ( ) ) ; mongoService . reportUnhealthy ( "Couldn't connect to server. Exception: " + e . toString ( ) ) ; return false ; } finally { if ( trustStore != null ) { trustStore . delete ( ) ; } } return true ; }
Creates a connection to the mongo server at the given location using the mongo java client .
592
20
160,661
private static SSLSocketFactory getSocketFactory ( File trustStore ) throws KeyStoreException , FileNotFoundException , IOException , NoSuchAlgorithmException , CertificateException , KeyManagementException { KeyStore keystore = KeyStore . getInstance ( "JKS" ) ; InputStream truststoreInputStream = null ; try { truststoreInputStream = new FileInputStream ( trustStore ) ; keystore . load ( truststoreInputStream , KEYSTORE_PW ) ; } finally { if ( truststoreInputStream != null ) { truststoreInputStream . close ( ) ; } } TrustManagerFactory trustManagerFactory = TrustManagerFactory . getInstance ( "PKIX" ) ; trustManagerFactory . init ( keystore ) ; TrustManager [ ] trustMangers = trustManagerFactory . getTrustManagers ( ) ; SSLContext sslContext = SSLContext . getInstance ( "TLS" ) ; sslContext . init ( null , trustMangers , null ) ; SSLSocketFactory sslSocketFactory = sslContext . getSocketFactory ( ) ; return sslSocketFactory ; }
Returns an SSLSocketFactory needed to connect to an SSL mongo server . The socket factory is created using the testTruststore . jks .
232
30
160,662
public static Locale converterTagLocaleFromString ( String name ) { try { Locale locale ; StringTokenizer st = new StringTokenizer ( name , "_" ) ; String language = st . nextToken ( ) ; if ( st . hasMoreTokens ( ) ) { String country = st . nextToken ( ) ; if ( st . hasMoreTokens ( ) ) { String variant = st . nextToken ( ) ; locale = new Locale ( language , country , variant ) ; } else { locale = new Locale ( language , country ) ; } } else { locale = new Locale ( language ) ; } return locale ; } catch ( Exception e ) { throw new IllegalArgumentException ( "Locale parsing exception - " + "invalid string representation '" + name + "'" ) ; } }
Convert locale string used by converter tags to locale .
171
11
160,663
public void incrementHeadSequenceNumber ( ConcurrentSubList . Link link ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "incrementheadSequenceNumber" , new Object [ ] { link } ) ; if ( link . next == null ) { // This subList is now empty. headSequenceNumber ++ ; // Look at another list next time. } else { // Still more links in this subList. ConcurrentSubList . Link nextLink = ( ConcurrentSubList . Link ) link . next . getManagedObject ( ) ; // If insertion into the body of the list has taken place, // then a sequenceNumber will have been duplicated. if ( nextLink . sequenceNumber != headSequenceNumber ) headSequenceNumber ++ ; } // if( firstLink.next == null). if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "incrementHeadSequenceNumber" , new Object [ ] { new Long ( headSequenceNumber ) } ) ; }
Increment the headSequenceNumber after removal of a link in a subList . Caller must already be synchronized on headSequenceNumberLock .
250
29
160,664
private void resetTailSequenceNumber ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "resetTailSequenceNumber" ) ; for ( int i = 0 ; i < subListTokens . length ; i ++ ) { subLists [ i ] = ( ( ConcurrentSubList ) subListTokens [ i ] . getManagedObject ( ) ) ; // In case another thread is currently removing the tail, take a safe copy. Token tailToken = subLists [ i ] . tail ; // Establish the highest existing tailSequenceNumber. if ( tailToken != null ) { ConcurrentSubList . Link tail = ( ConcurrentSubList . Link ) tailToken . getManagedObject ( ) ; tailSequenceNumber = Math . max ( tailSequenceNumber , tail . sequenceNumber ) ; } // if (tailToken != null). } // for subList. tailSequenceNumberSet = true ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "resetHeadSequenceNumber" ) ; }
Reset the tailSequenceNumber . Caller must be synchronized on tailSequenceNumberLock .
260
19
160,665
protected ConcurrentSubList . Link insert ( Token token , ConcurrentSubList . Link insertPoint , Transaction transaction ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "insert" , new Object [ ] { token , insertPoint , transaction } ) ; ConcurrentSubList . Link newLink = null ; synchronized ( transaction . internalTransaction ) { // Establish the sequenceNumber of this Object in the overall list, // before the insert point. long sequenceNumber = insertPoint . sequenceNumber ; sequenceNumber -- ; // Figure out which subList the Object should be added to. ConcurrentSubList list = getSublist ( sequenceNumber ) ; // Add the link near the tail of the list according to its assigned // sequence number. tailSequenceNumberLock . lock ( ) ; try { newLink = list . addEntry ( token , transaction , sequenceNumber , this ) ; } finally { if ( tailSequenceNumberLock . isHeldByCurrentThread ( ) ) tailSequenceNumberLock . unlock ( ) ; } // try (tailSequenceNumberLock). } // synchronized (transaction.internalTransaction). if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "insert" , new Object [ ] { newLink } ) ; return newLink ; }
Insert before the given link .
304
6
160,666
public void activate ( ComponentContext compcontext , Map < String , Object > properties ) { String methodName = "activate" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Activating the WebContainer bundle" ) ; } WebContainer . instance . set ( this ) ; this . context = compcontext ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Default Port [ " + DEFAULT_PORT + " ]" ) ; Tr . debug ( tc , methodName , "Default Virtual Host [ " + DEFAULT_VHOST_NAME + " ]" ) ; } WebContainerConfiguration webconfig = new WebContainerConfiguration ( DEFAULT_PORT ) ; webconfig . setDefaultVirtualHostName ( DEFAULT_VHOST_NAME ) ; this . initialize ( webconfig , properties ) ; this . classLoadingSRRef . activate ( context ) ; this . sessionHelperSRRef . activate ( context ) ; this . cacheManagerSRRef . activate ( context ) ; this . injectionEngineSRRef . activate ( context ) ; this . managedObjectServiceSRRef . activate ( context ) ; this . servletContainerInitializers . activate ( context ) ; this . transferContextServiceRef . activate ( context ) ; this . webMBeanRuntimeServiceRef . activate ( context ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Object mbeanService = context . locateService ( REFERENCE_WEB_MBEAN_RUNTIME ) ; Tr . debug ( tc , methodName , "Web MBean Runtime [ " + mbeanService + " ]" ) ; Tr . debug ( tc , methodName , "Web MBean Runtime Reference [ " + webMBeanRuntimeServiceRef . getReference ( ) + " ]" ) ; Tr . debug ( tc , methodName , "Web MBean Runtime Service [ " + webMBeanRuntimeServiceRef . getService ( ) + " ]" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Posting STARTED_EVENT" ) ; } Event event = this . eventService . createEvent ( WebContainerConstants . STARTED_EVENT ) ; this . eventService . postEvent ( event ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Posted STARTED_EVENT" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Activating the WebContainer bundle: Complete" ) ; } }
Activate the web container as a DS component .
621
10
160,667
@ FFDCIgnore ( Exception . class ) public void deactivate ( ComponentContext componentContext ) { String methodName = "deactivate" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Deactivating the WebContainer bundle" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Posting STOPPED_EVENT" ) ; } Event event = this . eventService . createEvent ( WebContainerConstants . STOPPED_EVENT ) ; this . eventService . postEvent ( event ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Posted STOPPED_EVENT" ) ; } this . classLoadingSRRef . deactivate ( componentContext ) ; this . sessionHelperSRRef . deactivate ( componentContext ) ; this . cacheManagerSRRef . deactivate ( componentContext ) ; this . injectionEngineSRRef . deactivate ( componentContext ) ; this . managedObjectServiceSRRef . deactivate ( context ) ; this . servletContainerInitializers . deactivate ( componentContext ) ; this . transferContextServiceRef . deactivate ( componentContext ) ; this . webMBeanRuntimeServiceRef . deactivate ( componentContext ) ; // will now purge each host as it becomes redundant rather than all here. //this.vhostManager.purge(); // Clear/purge all maps. WebContainer . instance . compareAndSet ( this , null ) ; extensionFactories . clear ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Deactivating the WebContainer bundle: Complete" ) ; } }
Deactivate the web container as a DS component .
409
10
160,668
@ Reference ( service = ClassLoadingService . class , name = "classLoadingService" ) protected void setClassLoadingService ( ServiceReference < ClassLoadingService > ref ) { classLoadingSRRef . setReference ( ref ) ; }
DS method for setting the class loading service reference .
48
10
160,669
@ Reference ( policy = ReferencePolicy . DYNAMIC ) protected void setEncodingService ( EncodingUtils encUtils ) { encodingServiceRef . set ( encUtils ) ; }
DS method for setting the Encoding service .
41
9
160,670
@ Reference ( service = SessionHelper . class , name = "sessionHelper" ) protected void setSessionHelper ( ServiceReference < SessionHelper > ref ) { sessionHelperSRRef . setReference ( ref ) ; }
Set the reference to the session helper service .
44
9
160,671
@ Override public ModuleMetaData createModuleMetaData ( ExtendedModuleInfo moduleInfo ) throws MetaDataException { WebModuleInfo webModule = ( WebModuleInfo ) moduleInfo ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "createModuleMetaData: " + webModule . getName ( ) + " " + webModule . getContextRoot ( ) ) ; } try { com . ibm . wsspi . adaptable . module . Container webModuleContainer = webModule . getContainer ( ) ; WebAppConfiguration appConfig = webModuleContainer . adapt ( WebAppConfiguration . class ) ; String appName = appConfig . getApplicationName ( ) ; String j2eeModuleName = appConfig . getJ2EEModuleName ( ) ; WebModuleMetaDataImpl wmmd = ( WebModuleMetaDataImpl ) appConfig . getMetaData ( ) ; wmmd . setJ2EEName ( j2eeNameFactory . create ( appName , j2eeModuleName , null ) ) ; appConfig . setWebApp ( createWebApp ( moduleInfo , appConfig ) ) ; return wmmd ; } catch ( Throwable e ) { Throwable cause = e . getCause ( ) ; MetaDataException m ; if ( ( cause != null ) && ( cause instanceof MetaDataException ) ) { m = ( MetaDataException ) cause ; //don't log a FFDC here as we already logged an exception } else { m = new MetaDataException ( e ) ; FFDCWrapper . processException ( e , getClass ( ) . getName ( ) , "createModuleMetaData" , new Object [ ] { webModule , this } ) ; //this throws the exception } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "createModuleMetaData: " + webModule . getName ( ) + "; " + e ) ; } throw m ; } }
This will create the metadata for a web module in the web container
438
13
160,672
protected void registerMBeans ( WebModuleMetaDataImpl webModule , com . ibm . wsspi . adaptable . module . Container container ) { String methodName = "registerMBeans" ; String appName = webModule . getApplicationMetaData ( ) . getName ( ) ; String webAppName = webModule . getName ( ) ; String debugName ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { debugName = appName + " " + webAppName ; } else { debugName = null ; } WebMBeanRuntime mBeanRuntime = webMBeanRuntimeServiceRef . getService ( ) ; if ( mBeanRuntime == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Web Module [ " + debugName + " ]: No MBean Runtime" ) ; } return ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Web Module [ " + debugName + " ]: MBean Runtime" ) ; } } String ddPath = com . ibm . ws . javaee . dd . web . WebApp . DD_NAME ; // This should be obtained by an adapt call. Iterator < IServletConfig > servletConfigs = webModule . getConfiguration ( ) . getServletInfos ( ) ; webModule . mBeanServiceReg = mBeanRuntime . registerModuleMBean ( appName , webAppName , container , ddPath , servletConfigs ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Web Module [ " + debugName + " ]: Registration [ " + webModule . mBeanServiceReg + " ]" ) ; } servletConfigs = webModule . getConfiguration ( ) . getServletInfos ( ) ; while ( servletConfigs . hasNext ( ) ) { IServletConfig servletConfig = servletConfigs . next ( ) ; String servletName = servletConfig . getServletName ( ) ; WebComponentMetaDataImpl wcmdi = ( WebComponentMetaDataImpl ) servletConfig . getMetaData ( ) ; wcmdi . mBeanServiceReg = mBeanRuntime . registerServletMBean ( appName , webAppName , servletName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Web Module [ " + debugName + " ] Servlet [ " + servletName + " ]: Registration [ " + wcmdi . mBeanServiceReg + " ]" ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName , "Web Module [ " + debugName + " ]: Completed registrations" ) ; } }
Check for the JSR77 runtime and if available use it to register module and servlet mbeans . As a side effect assign the mbean registration to the web module metadata and to the servlet metadata .
683
42
160,673
public void stopModule ( ExtendedModuleInfo moduleInfo ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "stopModule()" , ( ( WebModuleInfo ) moduleInfo ) . getName ( ) ) ; } WebModuleInfo webModule = ( WebModuleInfo ) moduleInfo ; try { DeployedModule dMod = this . deployedModuleMap . remove ( webModule ) ; if ( null == dMod ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "stopModule()" , "DeployedModule not known" ) ; } return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "stopModule: " + webModule . getName ( ) + " " + webModule . getContextRoot ( ) ) ; } removeContextRootRequirement ( dMod ) ; removeModule ( dMod ) ; this . vhostManager . purgeHost ( dMod . getVirtualHostName ( ) ) ; WebModuleMetaData wmmd = ( WebModuleMetaData ) ( ( ExtendedModuleInfo ) webModule ) . getMetaData ( ) ; deregisterMBeans ( ( WebModuleMetaDataImpl ) wmmd ) ; WebAppConfiguration appConfig = ( WebAppConfiguration ) wmmd . getConfiguration ( ) ; for ( Iterator < IServletConfig > servletConfigs = appConfig . getServletInfos ( ) ; servletConfigs . hasNext ( ) ; ) { IServletConfig servletConfig = servletConfigs . next ( ) ; metaDataService . fireComponentMetaDataDestroyed ( servletConfig . getMetaData ( ) ) ; } metaDataService . fireComponentMetaDataDestroyed ( appConfig . getDefaultComponentMetaData ( ) ) ; metaDataService . fireComponentMetaDataDestroyed ( wmmd . getCollaboratorComponentMetaData ( ) ) ; } catch ( Throwable e ) { FFDCWrapper . processException ( e , getClass ( ) . getName ( ) , "stopModule" , new Object [ ] { webModule , this } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "stopModule: " + webModule . getName ( ) + "; " + e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "stopModule()" ) ; } }
This will stop a web module in the web container
573
10
160,674
@ Reference ( cardinality = ReferenceCardinality . MANDATORY , policy = ReferencePolicy . DYNAMIC , policyOption = ReferencePolicyOption . GREEDY ) protected void setConnContextPool ( SRTConnectionContextPool pool ) { this . connContextPool = pool ; }
Only DS should invoke this method
61
6
160,675
public void refreshEntry ( com . ibm . wsspi . cache . CacheEntry ce ) { cacheInstance . refreshEntry ( ce . cacheEntry ) ; }
This method moves the specified entry to the end of the LRU queue .
34
15
160,676
public CacheEntry getEntryDisk ( Object cacheId ) { CacheEntry cacheEntry = new CacheEntry ( cacheInstance . getEntryDisk ( cacheId ) ) ; return cacheEntry ; }
This method returns the cache entry specified by cache ID from the disk cache .
38
15
160,677
public com . ibm . wsspi . cache . CacheEntry getEntry ( Object cacheId ) { CacheEntry cacheEntry = new CacheEntry ( cacheInstance . getEntry ( cacheId ) ) ; return cacheEntry ; }
This method returns an instance of CacheEntry specified cache ID .
47
12
160,678
public static Object [ ] getEncoding ( JspInputSource inputSource ) throws IOException , JspCoreException { InputStream inStream = XMLEncodingDetector . getInputStream ( inputSource ) ; //InputStream inStream = JspUtil.getInputStream(fname, jarFile, ctxt, // err); XMLEncodingDetector detector = new XMLEncodingDetector ( ) ; Object [ ] ret = detector . getEncoding ( inStream ) ; inStream . close ( ) ; return ret ; }
Autodetects the encoding of the XML document supplied by the given input stream .
119
18
160,679
private Reader createReader ( InputStream inputStream , String encoding , Boolean isBigEndian ) throws IOException , JspCoreException { // normalize encoding name if ( encoding == null ) { encoding = "UTF-8" ; } // try to use an optimized reader String ENCODING = encoding . toUpperCase ( Locale . ENGLISH ) ; if ( ENCODING . equals ( "UTF-8" ) ) { return new UTF8Reader ( inputStream , fBufferSize ) ; } if ( ENCODING . equals ( "US-ASCII" ) ) { return new ASCIIReader ( inputStream , fBufferSize ) ; } if ( ENCODING . equals ( "ISO-10646-UCS-4" ) ) { if ( isBigEndian != null ) { boolean isBE = isBigEndian . booleanValue ( ) ; if ( isBE ) { return new UCSReader ( inputStream , UCSReader . UCS4BE ) ; } else { return new UCSReader ( inputStream , UCSReader . UCS4LE ) ; } } else { throw new JspCoreException ( "jsp.error.xml.encodingByteOrderUnsupported" , new Object [ ] { encoding } ) ; //err.jspError("jsp.error.xml.encodingByteOrderUnsupported", // encoding); } } if ( ENCODING . equals ( "ISO-10646-UCS-2" ) ) { if ( isBigEndian != null ) { // sould never happen with this encoding... boolean isBE = isBigEndian . booleanValue ( ) ; if ( isBE ) { return new UCSReader ( inputStream , UCSReader . UCS2BE ) ; } else { return new UCSReader ( inputStream , UCSReader . UCS2LE ) ; } } else { throw new JspCoreException ( "jsp.error.xml.encodingByteOrderUnsupported" , new Object [ ] { encoding } ) ; //err.jspError("jsp.error.xml.encodingByteOrderUnsupported", // encoding); } } // check for valid name boolean validIANA = XMLChar . isValidIANAEncoding ( encoding ) ; boolean validJava = XMLChar . isValidJavaEncoding ( encoding ) ; if ( ! validIANA || ( fAllowJavaEncodings && ! validJava ) ) { encoding = "ISO-8859-1" ; throw new JspCoreException ( "jsp.error.xml.encodingDeclInvalid" , new Object [ ] { encoding } ) ; //err.jspError("jsp.error.xml.encodingDeclInvalid", encoding); // NOTE: AndyH suggested that, on failure, we use ISO Latin 1 // because every byte is a valid ISO Latin 1 character. // It may not translate correctly but if we failed on // the encoding anyway, then we're expecting the content // of the document to be bad. This will just prevent an // invalid UTF-8 sequence to be detected. This is only // important when continue-after-fatal-error is turned // on. -Ac } // try to use a Java reader String javaEncoding = EncodingMap . getIANA2JavaMapping ( ENCODING ) ; if ( javaEncoding == null ) { if ( fAllowJavaEncodings ) { javaEncoding = encoding ; } else { javaEncoding = "ISO8859_1" ; throw new JspCoreException ( "jsp.error.xml.encodingDeclInvalid" , new Object [ ] { encoding } ) ; //err.jspError("jsp.error.xml.encodingDeclInvalid", encoding); // see comment above. } } return new InputStreamReader ( inputStream , javaEncoding ) ; }
Creates a reader capable of reading the given input stream in the specified encoding .
810
16
160,680
final boolean load ( int offset , boolean changeEntity ) throws IOException { // read characters int length = fCurrentEntity . mayReadChunks ? ( fCurrentEntity . ch . length - offset ) : ( DEFAULT_XMLDECL_BUFFER_SIZE ) ; int count = fCurrentEntity . reader . read ( fCurrentEntity . ch , offset , length ) ; // reset count and position boolean entityChanged = false ; if ( count != - 1 ) { if ( count != 0 ) { fCurrentEntity . count = count + offset ; fCurrentEntity . position = offset ; } } // end of this entity else { fCurrentEntity . count = offset ; fCurrentEntity . position = offset ; entityChanged = true ; if ( changeEntity ) { endEntity ( ) ; if ( fCurrentEntity == null ) { throw new EOFException ( ) ; } // handle the trailing edges if ( fCurrentEntity . position == fCurrentEntity . count ) { load ( 0 , false ) ; } } } return entityChanged ; }
Loads a chunk of text .
217
7
160,681
public String scanPseudoAttribute ( boolean scanningTextDecl , XMLString value ) throws IOException , JspCoreException { String name = scanName ( ) ; if ( name == null ) { throw new JspCoreException ( "jsp.error.xml.pseudoAttrNameExpected" ) ; //err.jspError("jsp.error.xml.pseudoAttrNameExpected"); } skipSpaces ( ) ; if ( ! skipChar ( ' ' ) ) { reportFatalError ( scanningTextDecl ? "jsp.error.xml.eqRequiredInTextDecl" : "jsp.error.xml.eqRequiredInXMLDecl" , name ) ; } skipSpaces ( ) ; int quote = peekChar ( ) ; if ( quote != ' ' && quote != ' ' ) { reportFatalError ( scanningTextDecl ? "jsp.error.xml.quoteRequiredInTextDecl" : "jsp.error.xml.quoteRequiredInXMLDecl" , name ) ; } scanChar ( ) ; int c = scanLiteral ( quote , value ) ; if ( c != quote ) { fStringBuffer2 . clear ( ) ; do { fStringBuffer2 . append ( value ) ; if ( c != - 1 ) { if ( c == ' ' || c == ' ' || c == ' ' || c == ' ' ) { fStringBuffer2 . append ( ( char ) scanChar ( ) ) ; } else if ( XMLChar . isHighSurrogate ( c ) ) { scanSurrogates ( fStringBuffer2 ) ; } else if ( XMLChar . isInvalid ( c ) ) { String key = scanningTextDecl ? "jsp.error.xml.invalidCharInTextDecl" : "jsp.error.xml.invalidCharInXMLDecl" ; reportFatalError ( key , Integer . toString ( c , 16 ) ) ; scanChar ( ) ; } } c = scanLiteral ( quote , value ) ; } while ( c != quote ) ; fStringBuffer2 . append ( value ) ; value . setValues ( fStringBuffer2 ) ; } if ( ! skipChar ( quote ) ) { reportFatalError ( scanningTextDecl ? "jsp.error.xml.closeQuoteMissingInTextDecl" : "jsp.error.xml.closeQuoteMissingInXMLDecl" , name ) ; } // return return name ; }
Scans a pseudo attribute .
525
6
160,682
private void reportFatalError ( String msgId , String arg ) throws JspCoreException { throw new JspCoreException ( msgId , new Object [ ] { arg } ) ; //err.jspError(msgId, arg); }
Convenience function used in all XML scanners .
52
10
160,683
@ SuppressWarnings ( "unchecked" ) public static < T > T coerceToType ( FacesContext facesContext , Object value , Class < ? extends T > desiredClass ) { if ( value == null ) { return null ; } try { ExpressionFactory expFactory = facesContext . getApplication ( ) . getExpressionFactory ( ) ; // Use coersion implemented by JSP EL for consistency with EL // expressions. Additionally, it caches some of the coersions. return ( T ) expFactory . coerceToType ( value , desiredClass ) ; } catch ( ELException e ) { String message = "Cannot coerce " + value . getClass ( ) . getName ( ) + " to " + desiredClass . getName ( ) ; log . log ( Level . SEVERE , message , e ) ; throw new FacesException ( message , e ) ; } }
to unified EL in JSF 1 . 2
189
9
160,684
private String getNarrowestScope ( FacesContext facesContext , String valueExpression ) { List < String > expressions = extractExpressions ( valueExpression ) ; // exclude NONE scope, if there are more than one ValueExpressions (see Spec for details) String narrowestScope = expressions . size ( ) == 1 ? NONE : APPLICATION ; boolean scopeFound = false ; for ( String expression : expressions ) { String valueScope = getScope ( facesContext , expression ) ; if ( valueScope == null ) { continue ; } // we have found at least one valid scope at this point scopeFound = true ; if ( SCOPE_COMPARATOR . compare ( valueScope , narrowestScope ) < 0 ) { narrowestScope = valueScope ; } } return scopeFound ? narrowestScope : null ; }
Gets the narrowest scope to which the ValueExpression points .
171
14
160,685
private String getFirstSegment ( String expression ) { int indexDot = expression . indexOf ( ' ' ) ; int indexBracket = expression . indexOf ( ' ' ) ; if ( indexBracket < 0 ) { return indexDot < 0 ? expression : expression . substring ( 0 , indexDot ) ; } if ( indexDot < 0 ) { return expression . substring ( 0 , indexBracket ) ; } return expression . substring ( 0 , Math . min ( indexDot , indexBracket ) ) ; }
Extract the first expression segment that is the substring up to the first . or [
116
18
160,686
@ SuppressWarnings ( "unchecked" ) public < T > T get ( EventLocal < T > key ) { EventLocalMap < EventLocal < ? > , Object > map = getMap ( key ) ; if ( null == map ) { return key . initialValue ( ) ; } return ( T ) map . get ( key ) ; }
Query the possible value for the provided EventLocal .
75
10
160,687
public < T > void set ( EventLocal < T > key , Object value ) { EventLocalMap < EventLocal < ? > , Object > map = getMap ( key ) ; if ( null == map ) { // the call to getMap would have created the inheritable map // if appropriate, thus always create a disconnected map here map = new EventLocalMap < EventLocal < ? > , Object > ( ) ; if ( key . isInheritable ( ) ) { this . inheritableLocals = map ; } else { this . locals = map ; } } map . put ( key , value ) ; }
Set the value for the provided EventLocal on this event .
129
12
160,688
@ SuppressWarnings ( "unchecked" ) public < T > T remove ( EventLocal < T > key ) { EventLocalMap < EventLocal < ? > , Object > map = getMap ( key ) ; if ( null != map ) { return ( T ) map . remove ( key ) ; } return null ; }
Remove any existing value for the provided EventLocal .
70
10
160,689
@ SuppressWarnings ( "unchecked" ) public < T > T getContextData ( String name ) { T rc = null ; if ( null != this . inheritableLocals ) { rc = ( T ) this . inheritableLocals . get ( name ) ; } if ( null == rc && null != this . locals ) { rc = ( T ) this . locals . get ( name ) ; } return rc ; }
Look for the EventLocal of the given name in this particular Event instance .
92
15
160,690
private static void setSystemProperties ( ) { // KernelBootstrap also sets these properties in case the bootstrap // agent wasn't used for some reason. String loggingManager = System . getProperty ( "java.util.logging.manager" ) ; //if (loggingManager == null) // System.setProperty("java.util.logging.manager", "com.ibm.ws.kernel.boot.logging.WsLogManager"); String managementBuilderInitial = System . getProperty ( "javax.management.builder.initial" ) ; if ( managementBuilderInitial == null ) System . setProperty ( "javax.management.builder.initial" , "com.ibm.ws.kernel.boot.jmx.internal.PlatformMBeanServerBuilder" ) ; }
Set system properties for JVM singletons .
171
10
160,691
final void setBodyType ( JmsBodyType value ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setBodyType" , value ) ; setSubtype ( value . toByte ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setBodyType" ) ; }
Set the type of the message body . This method is only used by message constructors .
104
18
160,692
private final Set < String > getNonSmokeAndMirrorsPropertyNameSet ( ) { /* Get the names of all the properties in the JMS Property Maps */ /* We need a copy so that we can add extra items, and so can the caller */ Set < String > names = new HashSet < String > ( ) ; // Add the names for the two flavours of properties, without creating lists // and maps unnecessarily. if ( mayHaveJmsUserProperties ( ) ) { names . addAll ( getJmsUserPropertyMap ( ) . keySet ( ) ) ; } if ( mayHaveMappedJmsSystemProperties ( ) ) { names . addAll ( getJmsSystemPropertyMap ( ) . keySet ( ) ) ; } // The MQMD properties may be in the JmsSystemPropertyMap AND the MQMSetPropertiesMap // however, the Set will cater for this as it doesn't allow duplicates. if ( hasMQMDPropertiesSet ( ) ) { names . addAll ( getMQMDSetPropertiesMap ( ) . keySet ( ) ) ; } return names ; }
Return a Set of just the non - smoke - and - mirrors property names
237
15
160,693
@ Override public Object getJMSXGroupSeq ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getJMSXGroupSeq" ) ; Object result = null ; if ( mayHaveMappedJmsSystemProperties ( ) ) { result = getObjectProperty ( SIProperties . JMSXGroupSeq ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getJMSXGroupSeq" , result ) ; return result ; }
getJMSXGroupSeq Return the value of the JMSXGroupSeq property if it exists . We can return it as object as that is all JMS API wants . Actually it only really cares whether it exists but we ll return Object rather than changing the callng code unnecessarily .
144
60
160,694
private void processSpecialSubjects ( ConfigurationAdmin configAdmin , String roleName , Dictionary < String , Object > roleProps , Set < String > pids ) { String [ ] specialSubjectPids = ( String [ ] ) roleProps . get ( CFG_KEY_SPECIAL_SUBJECT ) ; if ( specialSubjectPids == null || specialSubjectPids . length == 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No special subjects in role " + roleName ) ; } } else { Set < String > badSpecialSubjects = new HashSet < String > ( ) ; for ( int i = 0 ; i < specialSubjectPids . length ; i ++ ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "special subject pid " + i + ": " + specialSubjectPids [ i ] ) ; } pids . add ( specialSubjectPids [ i ] ) ; Configuration specialSubjectConfig = null ; try { specialSubjectConfig = configAdmin . getConfiguration ( specialSubjectPids [ i ] , bundleLocation ) ; } catch ( IOException ioe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Invalid special subject entry " + specialSubjectPids [ i ] ) ; } continue ; } if ( specialSubjectConfig == null || specialSubjectConfig . getProperties ( ) == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Null special subject element" , specialSubjectPids [ i ] ) ; } continue ; } Dictionary < String , Object > specialSubjectProps = specialSubjectConfig . getProperties ( ) ; final String type = ( String ) specialSubjectProps . get ( "type" ) ; if ( type == null || type . trim ( ) . isEmpty ( ) ) { continue ; } if ( badSpecialSubjects . contains ( type ) ) { // This special subject is already flagged as a duplicate continue ; } // TODO: check for invalid type if ( type . trim ( ) . isEmpty ( ) ) { // Empty entry, ignoring continue ; } if ( ! specialSubjects . add ( type ) ) { Tr . error ( tc , "AUTHZ_TABLE_DUPLICATE_ROLE_MEMBER" , getRoleName ( ) , CFG_KEY_SPECIAL_SUBJECT , type ) ; badSpecialSubjects . add ( type ) ; specialSubjects . remove ( type ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Role " + roleName + " has special subjects:" , specialSubjects ) ; } } }
Read and process all the specialSubject elements
634
8
160,695
@ Override public TxCollaboratorConfig preInvoke ( final HttpServletRequest request , final boolean isServlet23 ) throws ServletException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Calling preInvoke. Request=" + request + " | isServlet23=" + isServlet23 ) ; } //First we check if there's a global transaction try { final EmbeddableWebSphereTransactionManager tranManager = getTranMgr ( ) ; if ( tranManager != null ) { final Transaction incumbentTx = tranManager . getTransaction ( ) ; if ( incumbentTx != null ) { TransactionImpl incumbentTxImpl = null ; if ( incumbentTx instanceof TransactionImpl ) incumbentTxImpl = ( TransactionImpl ) incumbentTx ; if ( incumbentTxImpl != null && incumbentTxImpl . getTxType ( ) == UOWCoordinator . TXTYPE_NONINTEROP_GLOBAL ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "the tx is NONINTEROP_GLOBAL set it to null" ) ; } // The following call should nullify the current tx on the current thread (in this special case where the // TxType is TXTYPE_NONINTEROP_GLOBAL tranManager . suspend ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Global transaction was present." ) ; } //Yes! There's a global transaction. Check for timeout checkGlobalTimeout ( ) ; //Create config return object final TxCollaboratorConfig retConfig = new TxCollaboratorConfig ( ) ; retConfig . setIncumbentTx ( incumbentTx ) ; return retConfig ; } } } } catch ( SystemException e ) { Tr . error ( tc , "UNEXPECTED_TRAN_ERROR" , e . toString ( ) ) ; ServletException se = new ServletException ( "Unexpected error during transaction fetching: " , e ) ; throw se ; } //Ensure we have a LocalTransactionCurrent to work with LocalTransactionCurrent ltCurrent = getLtCurrent ( ) ; if ( ltCurrent == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Unable to resolve LocalTransactionCurrent" ) ; } return null ; } //Create config return object TxCollaboratorConfig retConfig = new TxCollaboratorConfig ( ) ; // see if there is a local transaction on the thread LocalTransactionCoordinator ltCoord = ltCurrent . getLocalTranCoord ( ) ; if ( ltCoord != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Suspending LTC's coord: " + ltCoord ) ; } //there was a transaction! We need to suspend it and put its coordinator into the config //so that we can resume it later retConfig . setSuspendTx ( ltCurrent . suspend ( ) ) ; } //begin a new local transaction on the thread ltCurrent . begin ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Began LTC's coord:" + ltCurrent . getLocalTranCoord ( ) ) ; } return retConfig ; }
Collaborator preInvoke .
786
7
160,696
private void resumeSuspendedLTC ( LocalTransactionCurrent ltCurrent , Object txConfig ) throws ServletException { //Check for any suspended LTC that needs to be resumed if ( txConfig instanceof TxCollaboratorConfig ) { Object suspended = ( ( TxCollaboratorConfig ) txConfig ) . getSuspendTx ( ) ; if ( suspended instanceof LocalTransactionCoordinator ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Resuming previously suspended LTC coord:" + suspended ) ; Tr . debug ( tc , "Registering LTC callback" ) ; } try { ltCurrent . resume ( ( ( LocalTransactionCoordinator ) suspended ) ) ; } catch ( IllegalStateException ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "IllegalStateException" , ex ) ; } try { // Clean-up the Tx ltCurrent . cleanup ( ) ; } catch ( InconsistentLocalTranException iltex ) { // Absorb any exception from cleanup - it doesn't really // matter if there are inconsistencies in cleanup. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "InconsistentLocalTranException" , iltex ) ; } } catch ( RolledbackException rbe ) { // We need to inform the user that completion // was affected by a call to setRollbackOnly // so rethrow as a ServletException. ServletException se = new ServletException ( "LocalTransaction rolled-back due to setRollbackOnly" , rbe ) ; throw se ; } } } } }
Resumes the LTC that was suspended during preInvoke if one was suspended .
384
17
160,697
public SerializationObject getSerializationObject ( ) { SerializationObject object ; synchronized ( ivListOfObjects ) { if ( ivListOfObjects . isEmpty ( ) ) { object = createNewObject ( ) ; } else { object = ivListOfObjects . remove ( ivListOfObjects . size ( ) - 1 ) ; } } return object ; }
Gets the next avaialable serialization object .
79
12
160,698
public void returnSerializationObject ( SerializationObject object ) { synchronized ( ivListOfObjects ) { if ( ivListOfObjects . size ( ) < MAXIMUM_NUM_OF_OBJECTS ) { ivListOfObjects . add ( object ) ; } } }
Returns a serialization object back into the pool .
62
10
160,699
public void add ( Object dependency , ValueSet valueSet ) { if ( dependency == null ) { throw new IllegalArgumentException ( "dependency cannot be null" ) ; } if ( valueSet != null ) { dependencyToEntryTable . put ( dependency , valueSet ) ; } }
This adds a valueSet for the specified dependency .
60
10