idx
int64 0
165k
| question
stringlengths 73
4.15k
| target
stringlengths 5
918
| len_question
int64 21
890
| len_target
int64 3
255
|
|---|---|---|---|---|
159,200
|
public static boolean isCharsetSupported ( String charset ) { Boolean supported = ( Boolean ) supportedEncodingsCache . get ( charset ) ; if ( supported != null ) { return supported . booleanValue ( ) ; } try { new String ( TEST_CHAR , charset ) ; supportedEncodingsCache . put ( charset , Boolean . TRUE ) ; } catch ( UnsupportedEncodingException e ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "isCharsetSupported" , "Encountered UnsupportedEncoding charset [" + charset + "]" ) ; } supportedEncodingsCache . put ( charset , Boolean . FALSE ) ; return false ; } return true ; }
|
rewritten as part of PK13492
| 192
| 8
|
159,201
|
public static < T > boolean compareInstance ( T t1 , T t2 ) { if ( t1 == t2 ) { return true ; } if ( t1 != null && t2 != null && t1 . equals ( t2 ) ) { return true ; } return false ; }
|
Compare tow instance . If both are null still equal
| 61
| 10
|
159,202
|
public static boolean compareStrings ( String s1 , String s2 ) { if ( s1 == s2 ) return true ; if ( s1 != null && s2 != null && s1 . equals ( s2 ) ) return true ; return false ; }
|
Compares two strings for equality . Either or both of the values may be null .
| 55
| 17
|
159,203
|
public static boolean compareQNames ( QName qn1 , QName qn2 ) { if ( qn1 == qn2 ) return true ; if ( qn1 == null || qn2 == null ) return false ; return qn1 . equals ( qn2 ) ; }
|
Compares two QNames for equality . Either or both of the values may be null .
| 63
| 18
|
159,204
|
public static boolean compareStringLists ( List < String > list1 , List < String > list2 ) { if ( list1 == null && list2 == null ) return true ; if ( list1 == null || list2 == null ) return false ; if ( list1 . size ( ) != list2 . size ( ) ) return false ; for ( int i = 0 ; i < list1 . size ( ) ; i ++ ) { if ( ! compareStrings ( list1 . get ( i ) , list2 . get ( i ) ) ) { return false ; } } return true ; }
|
Compares two lists of strings for equality .
| 126
| 9
|
159,205
|
public static boolean compareQNameLists ( List < QName > list1 , List < QName > list2 ) { if ( list1 == list2 ) return true ; if ( list1 == null || list2 == null ) return false ; if ( list1 . size ( ) != list2 . size ( ) ) return false ; for ( int i = 0 ; i < list1 . size ( ) ; i ++ ) { if ( ! compareQNames ( list1 . get ( i ) , list2 . get ( i ) ) ) return false ; } return true ; }
|
Compares two lists of QNames for equality .
| 123
| 10
|
159,206
|
public static < T > boolean compareLists ( List < T > list1 , List < T > list2 ) { if ( list1 == list2 ) return true ; if ( list1 == null || list2 == null ) return false ; if ( list1 . size ( ) != list2 . size ( ) ) return false ; for ( int i = 0 ; i < list1 . size ( ) ; i ++ ) { if ( ! list1 . get ( i ) . equals ( list2 . get ( i ) ) ) { return false ; } } return true ; }
|
Compare two lists
| 122
| 3
|
159,207
|
public boolean preProcess ( ConfigEntry configEntry ) { boolean valid = true ; // there is no override, use the default processorData if ( configEntry . processorData == null ) configEntry . processorData = new Object [ BASE_SLOTS ] ; //persistToDisk Property p = ( Property ) configEntry . properties . get ( PROPERTY_PERSIST_TO_DISK ) ; String val = p != null ? ( String ) p . value : null ; if ( val != null ) { val = val . trim ( ) ; configEntry . processorData [ SLOT_PERSIST_TO_DISK ] = new Boolean ( val ) ; } //do-not-cache p = ( Property ) configEntry . properties . get ( PROPERTY_DO_NOT_CACHE ) ; val = p != null ? ( String ) p . value : null ; if ( val != null ) { configEntry . processorData [ SLOT_DO_NOT_CACHE ] = new Boolean ( val ) ; } for ( int i = 0 ; i < configEntry . cacheIds . length ; i ++ ) valid &= preProcess ( configEntry . cacheIds [ i ] ) ; return valid ; }
|
preprocess any data
| 261
| 4
|
159,208
|
public JSConsumerSet getConsumerSet ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getConsumerSet" ) ; SibTr . exit ( tc , "getConsumerSet" , consumerSet ) ; } return consumerSet ; }
|
Returns the consumerSet .
| 73
| 5
|
159,209
|
public long size ( Transaction transaction ) throws ObjectManagerException { // No trace because this is used by toString(), and hence by trace itself; long sizeFound ; // For return; synchronized ( this ) { sizeFound = availableSize ; // Move through the map adding in any extra available entries. if ( transaction != null ) { Entry entry = firstEntry ( transaction ) ; while ( entry != null ) { if ( entry . state == Entry . stateToBeAdded && entry . lockedBy ( transaction ) ) sizeFound ++ ; entry = successor ( entry , transaction ) ; } // while (entry != null). } // if (transaction != null). } // synchronized (this). return sizeFound ; }
|
Returns the number of key - value mappings in this map which ara available to the transaction .
| 145
| 20
|
159,210
|
public synchronized boolean isEmpty ( Transaction transaction ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "isEmpty" , new Object [ ] { transaction } ) ; boolean returnValue ; if ( firstEntry ( transaction ) == null ) { returnValue = true ; } else { returnValue = false ; } if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "isEmpty" , new Object [ ] { new Boolean ( returnValue ) } ) ; return returnValue ; }
|
Determines if the tree is empty as viewed by the transaction . Returns true if there are no entries visible to the transaction and false if there are entries visible .
| 141
| 33
|
159,211
|
private Entry getEntry ( Object key ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "getEntry" , new Object [ ] { key } ) ; Entry entry = ( Entry ) super . find ( key ) ; if ( entry != null ) { // Look for the youngest duplicate. duplicateSearch : for ( ; ; ) { Entry predecessor = ( Entry ) predecessor ( entry ) ; if ( predecessor == null ) break duplicateSearch ; if ( compare ( key , predecessor . key ) != 0 ) break duplicateSearch ; entry = predecessor ; } // for (;;). } // if (entry != null) if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "getEntry" , new Object [ ] { entry } ) ; return entry ; }
|
Returns the first Entry matching the key or null if the map does not contain an entry for the key . The entry returned may be uncommited .
| 197
| 30
|
159,212
|
public synchronized void putDuplicate ( Object key , Token value , Transaction transaction ) throws ObjectManagerException { put ( key , value , transaction , true ) ; }
|
Associates the specified value with the specified key in this map . If the map previously contained a mapping for this key the old value is left alone and a new one added .
| 34
| 36
|
159,213
|
private void add ( Object key , Token value , Entry currentEntry , Transaction transaction , long logSpaceDelta ) throws ObjectManagerException { final String methodName = "add" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { key , value , currentEntry , transaction , new Long ( logSpaceDelta ) } ) ; Entry newEntry ; // Place the new Entry at a point greater than or equal to the currentEntry. keySearch : while ( true ) { if ( compare ( key , currentEntry . key ) < 0 ) { // Less than. if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , new Object [ ] { "Less than branch." , currentEntry . key } ) ; if ( currentEntry . left == null ) { // We have reached a less than leaf. newEntry = new Entry ( this , key , value , currentEntry , transaction ) ; transaction . add ( newEntry , logSpaceDelta ) ; currentEntry . setLeft ( newEntry ) ; break keySearch ; // Now included in the tree. } // if (currentEntry.left == null). // Look further into the less than tree. currentEntry = ( Entry ) currentEntry . getLeft ( ) ; } else { // Greater than or equal. if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , new Object [ ] { "Greater than branch." , currentEntry . key } ) ; if ( currentEntry . right == null ) { // Place to the right. // Add into the greater than side. newEntry = new Entry ( this , key , value , currentEntry , transaction ) ; transaction . add ( newEntry , logSpaceDelta ) ; currentEntry . setRight ( newEntry ) ; break keySearch ; // Now included in the tree. } // if (currentEntry.right == null). // Look further into the greater than tree. currentEntry = ( Entry ) currentEntry . getRight ( ) ; } // if (comparator... } // keySearch: while (.... size ++ ; balance ( newEntry ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; }
|
Add a new value to the tree at a point where they key is after all less than or equal keys and below the currentEntry .
| 526
| 27
|
159,214
|
private void undoPut ( ) throws ObjectManagerException { final String methodName = "undoPut" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName ) ; // Give back all of the remaining space. owningToken . objectStore . reserve ( ( int ) - reservedSpaceInStore , false ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; }
|
Reverse the action of addition to the map used after an add has failed to log anything .
| 119
| 20
|
159,215
|
public synchronized void clear ( Transaction transaction ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "clear" + "transaction=" + transaction + "(Transaction)" ) ; // Move through the map deleting each entry as we go. Entry entry = firstEntry ( transaction ) ; while ( entry != null ) { entry . remove ( transaction ) ; entry = successor ( entry , transaction ) ; } // while (entry != null). if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "clear" ) ; }
|
Removes all mappings from this TreeMap which are visible to the transaction . Actual deletion of the entries takes place when the transaction commits .
| 147
| 28
|
159,216
|
private int compare ( Object key1 , Object key2 ) { if ( comparator == null ) return ( ( Comparable ) key1 ) . compareTo ( key2 ) ; else return comparator . compare ( key1 , key2 ) ; }
|
Use the comparator to compare the two keys .
| 52
| 10
|
159,217
|
private synchronized void deleteEntry ( Entry entry , Transaction transaction ) throws ObjectManagerException { final String methodName = "deleteEntry" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { entry , transaction } ) ; // managedObjectsToAdd.clear(); // Not used. managedObjectsToReplace . clear ( ) ; // Reset from last time. tokensToNotify . clear ( ) ; // Reset from last time. reservedSpaceInStore = ( int ) storeSpaceForRemove ( ) ; rbDelete ( entry ) ; // We have changed the size at least. managedObjectsToReplace . add ( this ) ; // Harden the updates. Release some of the space we reserved earlier, // when we deleted the entry, or, if we are backing out, when we added it. // Releasing the reserved space ensures that the replace will succeed. tokensToNotify . add ( entry . getToken ( ) ) ; transaction . optimisticReplace ( null , new java . util . ArrayList ( managedObjectsToReplace ) , null , // No tokens to delete. new java . util . ArrayList ( tokensToNotify ) , - logSpaceForDelete ) ; // Release any surplus space we reserved in the store. // During recovery we don't do this because we will not have reserved the space anyway. if ( transaction . getObjectManagerStateState ( ) != ObjectManagerState . stateReplayingLog ) owningToken . objectStore . reserve ( - ( int ) reservedSpaceInStore , false ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; }
|
Finalise removal of an Entry from the tree .
| 379
| 10
|
159,218
|
void move ( AbstractTreeMap . Entry x , AbstractTreeMap . Entry y ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "move" , new Object [ ] { x , y } ) ; Entry yParent = ( Entry ) y . getParent ( ) ; // Set x into the position occupied by y. x . setParent ( yParent ) ; if ( yParent == null ) setRoot ( x ) ; else if ( yParent . getRight ( ) == y ) yParent . setRight ( x ) ; else yParent . setLeft ( x ) ; x . setLeft ( y . getLeft ( ) ) ; x . setRight ( y . getRight ( ) ) ; // Set the x to be the parent of y's children. if ( y . getLeft ( ) != null ) y . getLeft ( ) . setParent ( x ) ; if ( y . getRight ( ) != null ) y . getRight ( ) . setParent ( x ) ; x . setColor ( y . getColor ( ) ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "move" , new Object [ ] { x } ) ; }
|
Move x to occupy the position currently held by y .
| 289
| 11
|
159,219
|
public synchronized void print ( java . io . PrintWriter printWriter ) { printWriter . println ( "Dump of TreeMap size=" + size + "(long)" ) ; try { for ( Iterator iterator = entrySet ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { Entry entry = ( Entry ) iterator . next ( ) ; printWriter . println ( ( indexLabel ( entry ) + " " ) . substring ( 0 , 20 ) + ( entry . getColor ( ) ? " RED " : " BLACK" ) + " Entry=" + entry ) ; } // for(iterator... } catch ( ObjectManagerException objectManagerException ) { // No FFDC code needed. printWriter . println ( "Caught objectManagerException=" + objectManagerException ) ; objectManagerException . printStackTrace ( printWriter ) ; } // try... }
|
Print a dump of the Map .
| 182
| 7
|
159,220
|
public static boolean containsMultipleRoutingContext ( RESTRequest request ) { //TODO: add a check for query string if ( request instanceof ServletRESTRequestWithParams ) { ServletRESTRequestWithParams req = ( ServletRESTRequestWithParams ) request ; return ( req . getParam ( ClientProvider . COLLECTIVE_HOST_NAMES ) != null || request . getHeader ( ClientProvider . COLLECTIVE_HOST_NAMES ) != null ) ; } return request . getHeader ( ClientProvider . COLLECTIVE_HOST_NAMES ) != null ; }
|
Quick check for multiple - target routing context without actually fetching all pieces
| 131
| 14
|
159,221
|
public static String [ ] getRoutingContext ( RESTRequest request , boolean errorIfNull ) { //Look for headers first String targetHost = request . getHeader ( ClientProvider . ROUTING_KEY_HOST_NAME ) ; if ( targetHost != null ) { targetHost = URLDecoder ( targetHost , null ) ; String targetUserDir = request . getHeader ( ClientProvider . ROUTING_KEY_SERVER_USER_DIR ) ; String targetServer = request . getHeader ( ClientProvider . ROUTING_KEY_SERVER_NAME ) ; targetUserDir = ( targetUserDir == null ) ? null : URLDecoder ( targetUserDir , null ) ; targetServer = ( targetServer == null ) ? null : URLDecoder ( targetServer , null ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( "RESTHelper" , tc , "Found routing context in headers. Host:" + targetHost + " | UserDir:" + targetUserDir + " | Server:" + targetServer ) ; } return new String [ ] { targetHost , targetUserDir , targetServer } ; } else { //TODO: re-visit once a decision is made on the value of these keys (current values are too big //Look for query strings (note: query params are not automatically decoded when returned from getQueryString()) final String queryStr = request . getQueryString ( ) ; //Optimization: Do a quick lookup to see if the raw queryStr contains a routing context key if ( queryStr == null || ! queryStr . contains ( ClientProvider . ROUTING_KEY_HOST_NAME ) ) { if ( errorIfNull ) { //TODO: make real translated message throw ErrorHelper . createRESTHandlerJsonException ( new IOException ( "routing context was not present in the request!" ) , null , APIConstants . STATUS_BAD_REQUEST ) ; } return null ; } //We know it contains at least the host, so split it String [ ] queryParts = queryStr . split ( "[&=]" ) ; String [ ] routingParams = new String [ 3 ] ; final int size = queryParts . length ; for ( int i = 0 ; i < size ; i ++ ) { if ( ClientProvider . ROUTING_KEY_HOST_NAME . equals ( queryParts [ i ] ) ) { //The value will be at i + 1 routingParams [ 0 ] = URLDecoder ( queryParts [ i + 1 ] , null ) ; //Move to next key i ++ ; continue ; } else if ( ClientProvider . ROUTING_KEY_SERVER_USER_DIR . equals ( queryParts [ i ] ) ) { //The value will be at i + 1 routingParams [ 1 ] = URLDecoder ( queryParts [ i + 1 ] , null ) ; //Move to next key i ++ ; continue ; } else if ( ClientProvider . ROUTING_KEY_SERVER_NAME . equals ( queryParts [ i ] ) ) { //The value will be at i + 1 routingParams [ 2 ] = URLDecoder ( queryParts [ i + 1 ] , null ) ; //Move to next key i ++ ; continue ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( "RESTHelper" , tc , "Found routing context in queryStr. Host:" + routingParams [ 0 ] + " | UserDir:" + routingParams [ 1 ] + " | Server:" + routingParams [ 2 ] ) ; } return routingParams ; } }
|
This helper method looks for the routing keys in the HTTP headers first and then fallsback into looking at the query string .
| 799
| 24
|
159,222
|
public static boolean isDefaultAttributeValue ( Object value ) { if ( value == null ) { return true ; } else if ( value instanceof Boolean ) { return ! ( ( Boolean ) value ) . booleanValue ( ) ; } else if ( value instanceof Number ) { if ( value instanceof Integer ) { return ( ( Number ) value ) . intValue ( ) == Integer . MIN_VALUE ; } else if ( value instanceof Double ) { return ( ( Number ) value ) . doubleValue ( ) == Double . MIN_VALUE ; } else if ( value instanceof Long ) { return ( ( Number ) value ) . longValue ( ) == Long . MIN_VALUE ; } else if ( value instanceof Byte ) { return ( ( Number ) value ) . byteValue ( ) == Byte . MIN_VALUE ; } else if ( value instanceof Float ) { return ( ( Number ) value ) . floatValue ( ) == Float . MIN_VALUE ; } else if ( value instanceof Short ) { return ( ( Number ) value ) . shortValue ( ) == Short . MIN_VALUE ; } } return false ; }
|
See JSF Spec . 8 . 5 Table 8 - 1
| 234
| 12
|
159,223
|
public static Converter findUIOutputConverter ( FacesContext facesContext , UIOutput component ) throws FacesException { return _SharedRendererUtils . findUIOutputConverter ( facesContext , component ) ; }
|
Find the proper Converter for the given UIOutput component .
| 48
| 12
|
159,224
|
public static Converter findUISelectManyConverter ( FacesContext facesContext , UISelectMany component ) { return findUISelectManyConverter ( facesContext , component , false ) ; }
|
Calls findUISelectManyConverter with considerValueType = false .
| 44
| 17
|
159,225
|
public static Converter findUISelectManyConverter ( FacesContext facesContext , UISelectMany component , boolean considerValueType ) { // If the component has an attached Converter, use it. Converter converter = component . getConverter ( ) ; if ( converter != null ) { return converter ; } if ( considerValueType ) { // try to get a converter from the valueType attribute converter = _SharedRendererUtils . getValueTypeConverter ( facesContext , component ) ; if ( converter != null ) { return converter ; } } //Try to find out by value expression ValueExpression ve = component . getValueExpression ( "value" ) ; if ( ve == null ) { return null ; } // Try to get the type from the actual value or, // if value == null, obtain the type from the ValueExpression Class < ? > valueType = null ; Object value = ve . getValue ( facesContext . getELContext ( ) ) ; valueType = ( value != null ) ? value . getClass ( ) : ve . getType ( facesContext . getELContext ( ) ) ; if ( valueType == null ) { return null ; } // a valueType of Object is also permitted, in order to support // managed bean properties of type Object that resolve to null at this point if ( Collection . class . isAssignableFrom ( valueType ) || Object . class . equals ( valueType ) ) { // try to get the by-type-converter from the type of the SelectItems return _SharedRendererUtils . getSelectItemsValueConverter ( new SelectItemsIterator ( component , facesContext ) , facesContext ) ; } if ( ! valueType . isArray ( ) ) { throw new IllegalArgumentException ( "ValueExpression for UISelectMany : " + getPathToComponent ( component ) + " must be of type Collection or Array" ) ; } Class < ? > arrayComponentType = valueType . getComponentType ( ) ; if ( String . class . equals ( arrayComponentType ) ) { return null ; //No converter needed for String type } if ( Object . class . equals ( arrayComponentType ) ) { // There is no converter for Object class // try to get the by-type-converter from the type of the SelectItems return _SharedRendererUtils . getSelectItemsValueConverter ( new SelectItemsIterator ( component , facesContext ) , facesContext ) ; } try { return facesContext . getApplication ( ) . createConverter ( arrayComponentType ) ; } catch ( FacesException e ) { log . log ( Level . SEVERE , "No Converter for type " + arrayComponentType . getName ( ) + " found" , e ) ; return null ; } }
|
Find proper Converter for the entries in the associated Collection or array of the given UISelectMany as specified in API Doc of UISelectMany . If considerValueType is true the valueType attribute will be used in addition to the standard algorithm to get a valid converter .
| 597
| 56
|
159,226
|
public static Set getSelectedValuesAsSet ( FacesContext context , UIComponent component , Converter converter , UISelectMany uiSelectMany ) { Object selectedValues = uiSelectMany . getValue ( ) ; return internalSubmittedOrSelectedValuesAsSet ( context , component , converter , uiSelectMany , selectedValues , true ) ; }
|
Convenient utility method that returns the currently selected values of a UISelectMany component as a Set of which the contains method can then be easily used to determine if a value is currently selected . Calling the contains method of this Set with the item value as argument returns true if this item is selected .
| 77
| 60
|
159,227
|
public static String getConvertedStringValue ( FacesContext context , UIComponent component , Converter converter , Object value ) { if ( converter == null ) { if ( value == null ) { return "" ; } else if ( value instanceof String ) { return ( String ) value ; } else { return value . toString ( ) ; } } return converter . getAsString ( context , component , value ) ; }
|
Convenient utility method that returns the currently given value as String using the given converter . Especially usefull for dealing with primitive types .
| 88
| 26
|
159,228
|
public static String getConvertedStringValue ( FacesContext context , UIComponent component , Converter converter , SelectItem selectItem ) { return getConvertedStringValue ( context , component , converter , selectItem . getValue ( ) ) ; }
|
Convenient utility method that returns the currently given SelectItem value as String using the given converter . Especially usefull for dealing with primitive types .
| 52
| 28
|
159,229
|
public static Object getConvertedUISelectManyValue ( FacesContext facesContext , UISelectMany selectMany , Object submittedValue , boolean considerValueType ) throws ConverterException { if ( submittedValue == null ) { return null ; } if ( ! ( submittedValue instanceof String [ ] ) ) { throw new ConverterException ( "Submitted value of type String[] for component : " + getPathToComponent ( selectMany ) + "expected" ) ; } return _SharedRendererUtils . getConvertedUISelectManyValue ( facesContext , selectMany , ( String [ ] ) submittedValue , considerValueType ) ; }
|
Gets the converted value of a UISelectMany component .
| 137
| 13
|
159,230
|
public static void initPartialValidationAndModelUpdate ( UIComponent component , FacesContext facesContext ) { String actionFor = ( String ) component . getAttributes ( ) . get ( "actionFor" ) ; if ( actionFor != null ) { List li = convertIdsToClientIds ( actionFor , facesContext , component ) ; facesContext . getExternalContext ( ) . getRequestMap ( ) . put ( ACTION_FOR_LIST , li ) ; String actionForPhase = ( String ) component . getAttributes ( ) . get ( "actionForPhase" ) ; if ( actionForPhase != null ) { List phaseList = convertPhasesToPhasesIds ( actionForPhase ) ; facesContext . getExternalContext ( ) . getRequestMap ( ) . put ( ACTION_FOR_PHASE_LIST , phaseList ) ; } } }
|
check for partial validation or model update attributes being set and initialize the request - map accordingly . SubForms will work with this information .
| 184
| 27
|
159,231
|
@ Deprecated public static ResponseStateManager getResponseStateManager ( FacesContext facesContext , String renderKitId ) throws FacesException { RenderKit renderKit = facesContext . getRenderKit ( ) ; if ( renderKit == null ) { // look for the renderkit in the request Map attributesMap = facesContext . getAttributes ( ) ; RenderKitFactory factory = ( RenderKitFactory ) attributesMap . get ( RENDER_KIT_IMPL ) ; if ( factory != null ) { renderKit = factory . getRenderKit ( facesContext , renderKitId ) ; } else { factory = ( RenderKitFactory ) FactoryFinder . getFactory ( FactoryFinder . RENDER_KIT_FACTORY ) ; if ( factory == null ) { throw new IllegalStateException ( "Factory is null" ) ; } attributesMap . put ( RENDER_KIT_IMPL , factory ) ; renderKit = factory . getRenderKit ( facesContext , renderKitId ) ; } } if ( renderKit == null ) { throw new IllegalArgumentException ( "Could not find a RenderKit for \"" + renderKitId + "\"" ) ; } return renderKit . getResponseStateManager ( ) ; }
|
Gets the ResponseStateManager for the renderKit Id provided
| 259
| 12
|
159,232
|
static public String toResourceUri ( FacesContext facesContext , Object o ) { if ( o == null ) { return null ; } String uri = o . toString ( ) ; // *** EL Coercion problem *** // If icon or image attribute was declared with #{resource[]} and that expression // evaluates to null (it means ResourceHandler.createResource returns null because // requested resource does not exist) // EL implementation turns null into "" // see http://www.irian.at/blog/blogid/unifiedElCoercion/#unifiedElCoercion if ( uri . length ( ) == 0 ) { return null ; } // With JSF 2.0 url for resources can be done with EL like #{resource['resourcename']} // and such EL after evalution contains context path for the current web application already, // -> we dont want call viewHandler.getResourceURL() if ( uri . contains ( ResourceHandler . RESOURCE_IDENTIFIER ) ) { return uri ; } // Treat two slashes as server-relative if ( uri . startsWith ( "//" ) ) { return uri . substring ( 1 ) ; } else { // If the specified path starts with a "/", // following method will prefix it with the context path for the current web application, // and return the result String resourceURL = facesContext . getApplication ( ) . getViewHandler ( ) . getResourceURL ( facesContext , uri ) ; return facesContext . getExternalContext ( ) . encodeResourceURL ( resourceURL ) ; } }
|
Coerces an object into a resource URI calling the view - handler .
| 334
| 15
|
159,233
|
public final static String trim ( String value ) { String result = null ; if ( null != value ) { result = value . trim ( ) ; } return result ; }
|
remove the blank characters in the left and right for a given value .
| 35
| 14
|
159,234
|
protected void customizeClientProperties ( Message message ) { if ( null == configPropertiesSet ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "There are no client properties." ) ; } return ; } Bus bus = message . getExchange ( ) . getBus ( ) ; if ( null == bus ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The bus is null" ) ; } return ; } for ( ConfigProperties configProps : configPropertiesSet ) { if ( JaxWsConstants . HTTP_CONDUITS_SERVICE_FACTORY_PID . equals ( configProps . getFactoryPid ( ) ) ) { customizeHttpConduitProperties ( message , bus , configProps ) ; } } }
|
Customize the client properties .
| 199
| 6
|
159,235
|
protected void customizePortAddress ( Message message ) { String address = null ; PortComponentRefInfo portInfo = null ; if ( null != wsrInfo ) { QName portQName = getPortQName ( message ) ; if ( null != portQName ) { portInfo = wsrInfo . getPortComponentRefInfo ( portQName ) ; address = ( null != portInfo && null != portInfo . getAddress ( ) ) ? portInfo . getAddress ( ) : wsrInfo . getDefaultPortAddress ( ) ; } } if ( null != address ) { //change the endpoint address if there is a valid one. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The endpoint address is overriden by " + address ) ; } message . put ( Message . ENDPOINT_ADDRESS , address ) ; } }
|
Customize the port address
| 196
| 5
|
159,236
|
private static String discoverClassName ( ClassLoader tccl ) { String className = null ; // First services API className = getClassNameServices ( tccl ) ; if ( className == null ) { if ( IS_SECURITY_ENABLED ) { className = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override public String run ( ) { return getClassNameJreDir ( ) ; } } ) ; } else { // Second el.properties file className = getClassNameJreDir ( ) ; } } if ( className == null ) { if ( IS_SECURITY_ENABLED ) { className = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override public String run ( ) { return getClassNameSysProp ( ) ; } } ) ; } else { // Third system property className = getClassNameSysProp ( ) ; } } if ( className == null ) { // Fourth - default className = "org.apache.el.ExpressionFactoryImpl" ; } return className ; }
|
Discover the name of class that implements ExpressionFactory .
| 241
| 10
|
159,237
|
private static void addBundleManifestRequireCapability ( FileSystem zipSystem , Path bundle , Map < Path , String > requiresMap ) throws IOException { Path extractedJar = null ; try { // Need to extract the bundles to read their manifest, can't find a way to do this in place. extractedJar = Files . createTempFile ( "unpackedBundle" , ".jar" ) ; extractedJar . toFile ( ) . deleteOnExit ( ) ; Files . copy ( bundle , extractedJar , StandardCopyOption . REPLACE_EXISTING ) ; Manifest bundleJarManifest = null ; JarFile bundleJar = null ; try { bundleJar = new JarFile ( extractedJar . toFile ( ) ) ; bundleJarManifest = bundleJar . getManifest ( ) ; } finally { if ( bundleJar != null ) { bundleJar . close ( ) ; } } Attributes bundleManifestAttrs = bundleJarManifest . getMainAttributes ( ) ; String requireCapabilityAttr = bundleManifestAttrs . getValue ( REQUIRE_CAPABILITY_HEADER_NAME ) ; if ( requireCapabilityAttr != null ) { requiresMap . put ( bundle , requireCapabilityAttr ) ; } } finally { if ( extractedJar != null ) { extractedJar . toFile ( ) . delete ( ) ; } } }
|
Adds the Require - Capability Strings from a bundle jar to the Map of Require - Capabilities found
| 286
| 23
|
159,238
|
private static void addSubsystemManifestRequireCapability ( File esa , Map < Path , String > requiresMap ) throws IOException { String esaLocation = esa . getAbsolutePath ( ) ; ZipFile zip = null ; try { zip = new ZipFile ( esaLocation ) ; Enumeration < ? extends ZipEntry > zipEntries = zip . entries ( ) ; ZipEntry subsystemEntry = null ; while ( zipEntries . hasMoreElements ( ) ) { ZipEntry nextEntry = zipEntries . nextElement ( ) ; if ( "OSGI-INF/SUBSYSTEM.MF" . equalsIgnoreCase ( nextEntry . getName ( ) ) ) { subsystemEntry = nextEntry ; break ; } } if ( subsystemEntry == null ) { ; } else { Manifest m = ManifestProcessor . parseManifest ( zip . getInputStream ( subsystemEntry ) ) ; Attributes manifestAttrs = m . getMainAttributes ( ) ; String requireCapabilityAttr = manifestAttrs . getValue ( REQUIRE_CAPABILITY_HEADER_NAME ) ; requiresMap . put ( esa . toPath ( ) , requireCapabilityAttr ) ; } } finally { if ( zip != null ) { zip . close ( ) ; } } }
|
Adds the Require - Capability Strings from a SUBSYSTEM . MF to the Map of Require - Capabilities found
| 274
| 27
|
159,239
|
@ Override public void filter ( ClientRequestContext requestContext ) { // if ( requestContext == null || jwt == null || requestContext . getHeaders ( ) . containsKey ( "Authorization" ) ) { return ; } if ( header == null || header . equals ( "" ) ) { header = "Authorization" ; } final String headerValue ; if ( "Authorization" . equals ( header ) ) { headerValue = "Bearer " + jwt ; } else { headerValue = jwt ; } requestContext . getHeaders ( ) . add ( header , headerValue ) ; }
|
Adds the JWT token to the Authorization header in the jax - rs client requests to propagate the token .
| 128
| 22
|
159,240
|
public static String urlDecode ( String value , String enc ) { return urlDecode ( value , enc , false ) ; }
|
Decodes using URLDecoder - use when queries or form post values are decoded
| 27
| 17
|
159,241
|
public static String pathDecode ( String value ) { return urlDecode ( value , StandardCharsets . UTF_8 . name ( ) , true ) ; }
|
URL path segments may contain + symbols which should not be decoded into This method replaces + with %2B and delegates to URLDecoder
| 35
| 28
|
159,242
|
public static Map < String , String > parseQueryString ( String s ) { Map < String , String > ht = new HashMap < String , String > ( ) ; StringTokenizer st = new StringTokenizer ( s , "&" ) ; while ( st . hasMoreTokens ( ) ) { String pair = st . nextToken ( ) ; int pos = pair . indexOf ( ' ' ) ; if ( pos == - 1 ) { ht . put ( pair . toLowerCase ( ) , "" ) ; } else { ht . put ( pair . substring ( 0 , pos ) . toLowerCase ( ) , pair . substring ( pos + 1 ) ) ; } } return ht ; }
|
Create a map from String to String that represents the contents of the query portion of a URL . For each x = y x is the key and y is the value .
| 152
| 34
|
159,243
|
public static String getStem ( String baseURI ) { int idx = baseURI . lastIndexOf ( ' ' ) ; String result = baseURI ; if ( idx != - 1 ) { result = baseURI . substring ( 0 , idx ) ; } return result ; }
|
Return everything in the path up to the last slash in a URI .
| 61
| 14
|
159,244
|
private synchronized CacheEntryWrapper updateCacheList ( Object key ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINER ) ) { LoggingUtil . SESSION_LOGGER_CORE . entering ( methodClassName , methodNames [ UPDATE_CACHE_LIST ] , "key=" + key ) ; } CacheEntryWrapper entry = ( CacheEntryWrapper ) super . get ( key ) ; if ( entry == null ) { return null ; } CacheEntryWrapper prev = entry . prev ; CacheEntryWrapper next = entry . next ; if ( prev != null ) { prev . next = next ; entry . prev = null ; entry . next = mru ; mru . prev = entry ; mru = entry ; if ( next != null ) next . prev = prev ; else lru = prev ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { //PM16861 LoggingUtil . SESSION_LOGGER_CORE . exiting ( methodClassName , methodNames [ UPDATE_CACHE_LIST ] , "Returning object associated with this key=" + key ) ; } return entry ; }
|
remove the input entry from it s spot in the list and make it the mru
| 316
| 17
|
159,245
|
public SICoreConnection getSICoreConnection ( ) throws IllegalStateException { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "getSICoreConnection" ) ; } if ( _sessionClosed ) { throw new IllegalStateException ( NLS . getFormattedMessage ( ( "ILLEGAL_STATE_CWSJR1123" ) , new Object [ ] { "getSICoreConnection" } , null ) ) ; } if ( _sessionInvalidated ) { throw new IllegalStateException ( NLS . getFormattedMessage ( ( "ILLEGAL_STATE_CWSJR1124" ) , new Object [ ] { "getSICoreConnection" } , null ) ) ; } SICoreConnection coreConnection = null ; if ( _connection != null ) { coreConnection = _connection . getSICoreConnection ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "getSICoreConnection" , coreConnection ) ; } return coreConnection ; }
|
A convenience method that returns the core connection associated with this session s connection .
| 259
| 15
|
159,246
|
void dissociate ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "dissociate" ) ; } _managedConnection = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "dissociate" ) ; } }
|
Dissociates this session from its current managed connection .
| 97
| 12
|
159,247
|
void associate ( final JmsJcaManagedConnection managedConnection ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "associate" , managedConnection ) ; } if ( _managedConnection != null ) { _managedConnection . disassociateSession ( this ) ; } _managedConnection = managedConnection ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "associate" ) ; } }
|
Associates this session with a new managed connection .
| 130
| 11
|
159,248
|
void invalidate ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "invalidate" ) ; } _sessionInvalidated = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "invalidate" ) ; } }
|
Marks this session as invalid .
| 98
| 7
|
159,249
|
void setParentConnection ( final JmsJcaConnectionImpl connection ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "setParentConnection" , connection ) ; } _connection = connection ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "setParentConnection" ) ; } }
|
Sets the parent connection for this session .
| 107
| 9
|
159,250
|
private void addJCDIInterceptors ( ) { // Must be in a JCDI enabled module, and not a ManagedBean JCDIHelper jcdiHelper = ivEJBModuleMetaDataImpl . ivJCDIHelper ; if ( jcdiHelper != null && ! ivBmd . isManagedBean ( ) ) // F743-34301.1 { // Obtain the interceptor to start the interceptor chain. F743-29169 J2EEName j2eeName = ivEJBModuleMetaDataImpl . ivJ2EEName ; ivJCDIFirstInterceptorClass = jcdiHelper . getFirstEJBInterceptor ( j2eeName , ivEjbClass ) ; if ( ivJCDIFirstInterceptorClass != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "addJCDIInterceptor : " + ivJCDIFirstInterceptorClass . getName ( ) ) ; ivInterceptorNameToClassMap . put ( ivJCDIFirstInterceptorClass . getName ( ) , ivJCDIFirstInterceptorClass ) ; } // Obtain the interceptor at the end of the interceptor chain. ivJCDILastInterceptorClass = jcdiHelper . getEJBInterceptor ( j2eeName , ivEjbClass ) ; if ( ivJCDILastInterceptorClass != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "addJCDIInterceptor : " + ivJCDILastInterceptorClass . getName ( ) ) ; ivInterceptorNameToClassMap . put ( ivJCDILastInterceptorClass . getName ( ) , ivJCDILastInterceptorClass ) ; } } }
|
F743 - 15628 d649636
| 413
| 10
|
159,251
|
private List < String > addLoadedInterceptorClasses ( Class < ? > [ ] classes ) // d630717 { List < String > names = new ArrayList < String > ( ) ; for ( Class < ? > klass : classes ) { String className = klass . getName ( ) ; ivInterceptorNameToClassMap . put ( className , klass ) ; names . add ( className ) ; } return names ; }
|
Adds a class to the list of loaded classes . getInterceptorProxies relies on every interceptor class either being added via updateNamesToClassMap or this method .
| 96
| 35
|
159,252
|
private ArrayList < String > addMethodLevelInterceptors ( Method method , EJBInterceptorBinding methodBinding ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "addMethodLevelInterceptors method: " + method . getName ( ) ) ; } // List of method-level interceptor names to return to the caller. ArrayList < String > interceptorNames = new ArrayList < String > ( ) ; if ( ! ivMetadataComplete ) { // Process annotation first since the interceptor classes from // annotation are the first ones that need to be called. Interceptors methodLevelInterceptors = method . getAnnotation ( Interceptors . class ) ; String methodName = method . getName ( ) ; if ( methodLevelInterceptors != null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "processing @Interceptor annotation for method: " + methodName + ", EJB name: " + ivEjbName ) ; } // Get list of interceptor names and classes. List < String > names = addLoadedInterceptorClasses ( methodLevelInterceptors . value ( ) ) ; // d630717 // Add to the interceptor names list to be returned to the caller. interceptorNames . addAll ( names ) ; } } // Now augment this list by processing the class level InterceptorBinding from // WCCM for this method of the EJB (if one exists). if ( methodBinding != null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "processing interceptor binding for method: " + method ) ; } List < String > names = methodBinding . ivInterceptorClassNames ; // d453477 updateNamesToClassMap ( names ) ; // d630717 // Add to the interceptor names list to be returned to the caller. interceptorNames . addAll ( names ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addMethodLevelInterceptors: " + interceptorNames ) ; } // Return list of method-level interceptor names for this business method. return interceptorNames ; }
|
d367572 . 9 updated for xml and metadata - complete .
| 515
| 14
|
159,253
|
private void updateEJBMethodInfoInterceptorProxies ( ) // d386227 throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "updateEJBMethodInfoInterceptorProxies: " + ivEjbName ) ; } // For each method, update EJBMethodInfo with the correct array of // InterceptorProxy array needed for that method. for ( Map . Entry < Method , ArrayList < EJBMethodInfoImpl > > entry : ivEJBMethodInfoMap . entrySet ( ) ) // d630717 { InterceptorProxy [ ] proxies = getAroundInterceptorProxies ( InterceptorMethodKind . AROUND_INVOKE , entry . getKey ( ) ) ; // F743-17763 // Update the EJBMethodInfos with the InterceptorProxy array for this method. if ( proxies != null ) { for ( EJBMethodInfoImpl info : entry . getValue ( ) ) // d630717 { info . setAroundInterceptorProxies ( proxies ) ; // F743-17763.1 } } } // F743-17763 - For each timer method, update EJBMethodInfo with the // correct array of InterceptorProxy for that method. The preceding loop // does not include EJBMethodInfoImpls for MethodInterface.TIMED_OBJECT, // so this loop's call to setAroundInterceptorProxies does not conflict. if ( ivBmd . timedMethodInfos != null ) { for ( EJBMethodInfoImpl info : ivBmd . timedMethodInfos ) { InterceptorProxy [ ] proxies = getAroundInterceptorProxies ( InterceptorMethodKind . AROUND_TIMEOUT , info . getMethod ( ) ) ; if ( proxies != null ) { info . setAroundInterceptorProxies ( proxies ) ; // F743-17763.1 } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "updateEJBMethodInfoInterceptorProxies: " + ivJ2EEName ) ; } }
|
d367572 . 9 updated for xml
| 484
| 9
|
159,254
|
private InterceptorProxy [ ] getAroundInterceptorProxies ( InterceptorMethodKind kind , Method m ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getAroundInterceptorProxies: " + kind + ", " + m ) ; } // d630717 - Unconditionally create an ordered list of interceptors to // pass to getInterceptorProxies. List < String > orderedList = orderMethodLevelInterceptors ( m ) ; // Now create the InterceptorProxy array required for business method specified // by the caller. InterceptorProxy [ ] proxies = getInterceptorProxies ( kind , orderedList ) ; // d630717 // Return the InterceptorProxy array for invoking around invoke interceptors // for the businesss method specified by the caller. if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getAroundInterceptorProxies" ) ; } return proxies ; }
|
Get the array of InterceptorProxy objects required for invoking the AroundInvoke or AroundTimeout interceptors methods when a method is invoked .
| 241
| 27
|
159,255
|
private void processBeanInterceptors ( ) // d630717 throws EJBConfigurationException { ivBeanInterceptorProxyMap = createInterceptorProxyMap ( ivEjbClass , - 1 ) ; // F743-1751 - Not all bean types collect bean methods. For those // that do, find the methods that are declared on the bean. if ( ivBeanLifecycleMethods != null ) { for ( InterceptorMethodKind kind : InterceptorMethodKind . values ( ) ) { int mid = kind . getMethodID ( ) ; if ( mid != - 1 ) { List < InterceptorProxy > proxyList = ivBeanInterceptorProxyMap . get ( kind ) ; if ( proxyList != null ) { for ( InterceptorProxy proxy : proxyList ) { Method m = proxy . ivInterceptorMethod ; if ( m . getDeclaringClass ( ) == ivEjbClass ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "found bean " + LifecycleInterceptorWrapper . TRACE_NAMES [ mid ] + " method: " + m ) ; ivBeanLifecycleMethods [ mid ] = m ; break ; } } } } } } }
|
Processes interceptor methods on the bean class .
| 277
| 10
|
159,256
|
private ArrayList < String > orderClassLevelInterceptors ( ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "orderClassLevelInterceptors" ) ; } // Create the default ordering of class level interceptor names // for this EJB. ArrayList < String > orderedList = new ArrayList < String > ( ) ; // First add default interceptor names if they are not excluded // at the class level. if ( ivExcludeDefaultFromClassLevel == false ) { if ( ivDefaultInterceptorNames . size ( ) > 0 ) { orderedList . addAll ( ivDefaultInterceptorNames ) ; } } // Now add in the class level interceptors. if ( ivClassInterceptorNames . size ( ) > 0 ) { orderedList . addAll ( ivClassInterceptorNames ) ; } // Now check whether order is overridden by a <interceptor-order> deployment // descriptor for this EJB. if ( ivClassInterceptorBinding != null ) { List < String > order = ivClassInterceptorBinding . ivInterceptorOrder ; // d453477 if ( ! order . isEmpty ( ) ) { // d472972 start // Yep, default order is being overridden. Verify the <interceptor-order> is // a complete ordering of the interceptors. ArrayList < String > interceptorOrder = new ArrayList < String > ( order ) ; if ( interceptorOrder . containsAll ( orderedList ) ) { // The order list is complete, so just use the order that was // provided by the interceptor-order deployment descriptor. orderedList = interceptorOrder ; } else { // CNTR0227E: The {1} enterprise bean has an interceptor-order element which specifies // the following interceptor-order list: {0}. This list is not a total ordering of the // class-level interceptors for this bean. It is missing the following interceptor names: {2} List < String > missingList ; if ( interceptorOrder . size ( ) < orderedList . size ( ) ) { orderedList . removeAll ( interceptorOrder ) ; missingList = orderedList ; } else { interceptorOrder . removeAll ( orderedList ) ; missingList = interceptorOrder ; } String ejbName = ivJ2EEName . toString ( ) ; Object [ ] data = new Object [ ] { ejbName , order , missingList } ; Tr . warning ( tc , "PARTIAL_CLASS_INTERCEPTOR_ORDER_CNTR0227E" , data ) ; throw new EJBConfigurationException ( order + " is not a total ordering of class-level interceptors for EJB " + ejbName + ". It is missing interceptor names: " + missingList ) ; } // d472972 end } } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "orderClassLevelInterceptors: " + orderedList ) ; } return orderedList ; }
|
Get an ordered list of class level interceptors to be used for this EJB .
| 676
| 17
|
159,257
|
@ Override public boolean containsCacheId ( Object cacheId ) { boolean found = false ; if ( cacheId != null ) { found = this . coreCache . containsCacheId ( cacheId ) ; } return found ; }
|
Returns true if memory cache contains a mapping for the specified cache ID .
| 47
| 14
|
159,258
|
@ Override public com . ibm . websphere . cache . CacheEntry getEntryFromMemory ( Object id ) { final String methodName = "getEntryFromMemory()" ; com . ibm . websphere . cache . CacheEntry ce = this . coreCache . get ( id ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " id=" + id + " cacheEntry=" + ce ) ; } return ce ; }
|
This returns the cache entry from memory cache identified by the specified cache id . It returns null if not in the cache .
| 111
| 24
|
159,259
|
@ Override public Enumeration getAllIds ( ) { Set ids = this . coreCache . getCacheIds ( ) ; ValueSet idvs = new ValueSet ( ids . iterator ( ) ) ; return idvs . elements ( ) ; }
|
Returns an enumeration view of the cache IDs contained in the memory cache .
| 56
| 15
|
159,260
|
@ Override public void internalInvalidateByDepId ( Object id , int causeOfInvalidation , int source , boolean bFireIL ) { final String methodName = "internalInvalidateByDepId()" ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " id=" + id ) ; } this . invalidateExternalCaches ( id , null ) ; this . coreCache . invalidateByDependency ( id , true ) ; }
|
This invalidates all entries in this Cache having a dependency on this dependency id .
| 112
| 16
|
159,261
|
@ Override public void invalidateByTemplate ( String template , boolean waitOnInvalidation ) { final String methodName = "invalidateByTemplate()" ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " template=" + template ) ; } this . invalidateExternalCaches ( null , template ) ; this . coreCache . invalidateByTemplate ( template , waitOnInvalidation ) ; }
|
This invalidates all entries in this Cache having a dependency on this template .
| 102
| 15
|
159,262
|
@ Override public void addAlias ( Object key , Object [ ] aliasArray , boolean askPermission , boolean coordinate ) { final String methodName = "addAlias()" ; if ( this . featureSupport . isAliasSupported ( ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " ERROR because it is not implemented yet" ) ; } } else { Tr . error ( tc , "DYNA1063E" , new Object [ ] { methodName , cacheName , this . cacheProviderName } ) ; } return ; }
|
Adds an alias for the given key in the cache s mapping table . If the alias is already associated with another key it will be changed to associate with the new key .
| 132
| 34
|
159,263
|
@ Override public void removeAlias ( Object alias , boolean askPermission , boolean coordinate ) { final String methodName = "removeAlias()" ; if ( this . featureSupport . isAliasSupported ( ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " ERROR because it is not implemented yet" ) ; } } else { Tr . error ( tc , "DYNA1063E" , new Object [ ] { methodName , cacheName , this . cacheProviderName } ) ; } return ; }
|
Removes an alias from the cache mapping .
| 126
| 9
|
159,264
|
@ Override public List getCacheIdsInPushPullTable ( ) { final String methodName = "getCacheIdsInPushPullTable()" ; List list = new ArrayList ( ) ; if ( this . featureSupport . isReplicationSupported ( ) ) { // TODO write code to support getCacheIdsInPushPullTable function if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " ERROR because it is not implemented yet" ) ; } } else { Tr . error ( tc , "DYNA1065E" , new Object [ ] { methodName , cacheName , this . cacheProviderName } ) ; } return list ; }
|
Returns all of the cache IDs in the PushPullTable
| 155
| 11
|
159,265
|
@ Override public boolean shouldPull ( int share , Object id ) { final String methodName = "shouldPull()" ; boolean shouldPull = false ; if ( this . featureSupport . isReplicationSupported ( ) ) { // TODO write code to support shouldPull function //if (tc.isDebugEnabled()) { // Tr.debug(tc, methodName + " cacheName=" + cacheName + " ERROR because it is not implemented yet"); //} } else { //Tr.error(tc, "DYNA1065E", new Object[] { methodName, cacheName, this.cacheProviderName}); } return shouldPull ; }
|
Return to indicate the entry can be pulled from other remote caches which caching this value .
| 136
| 17
|
159,266
|
@ Override public int getDepIdsSizeDisk ( ) { final String methodName = "getDepIdsSizeDisk()" ; if ( this . swapToDisk ) { // TODO write code to support getDepIdsSizeDisk function if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " ERROR because it is not implemented yet" ) ; } } else { if ( this . featureSupport . isDiskCacheSupported ( ) == false ) { Tr . error ( tc , "DYNA1064E" , new Object [ ] { methodName , cacheName , this . cacheProviderName } ) ; } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " no operation is done because the disk cache offload is not enabled" ) ; } } } return 0 ; }
|
Returns the current dependency IDs size for the disk cache .
| 201
| 11
|
159,267
|
@ Override public Exception getDiskCacheException ( ) { final String methodName = "getDiskCacheException()" ; Exception ex = null ; if ( this . swapToDisk ) { // TODO write code to support getDiskCacheException function if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " ERROR because it is not implemented yet" ) ; } } else { if ( this . featureSupport . isDiskCacheSupported ( ) == false ) { Tr . error ( tc , "DYNA1064E" , new Object [ ] { methodName , cacheName , this . cacheProviderName } ) ; } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " no operation is done because the disk cache offload is not enabled" ) ; } } } return ex ; }
|
Returns the exception object from the disk cache because disk cache reported the error .
| 200
| 15
|
159,268
|
@ Override public void resetPMICounters ( ) { // TODO needs to change if cache provider supports PMI counters. final String methodName = "resetPMICounters()" ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName ) ; } }
|
This method needs to change if cache provider supports PMI counters .
| 70
| 13
|
159,269
|
@ Override public void updateStatisticsForVBC ( com . ibm . websphere . cache . CacheEntry cacheEntry , boolean directive ) { // TODO needs to change if cache provider supports PMI and CacheStatisticsListener final String methodName = "updateStatisticsForVBC()" ; Object id = null ; if ( cacheEntry != null ) { id = cacheEntry . getIdObject ( ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " id=" + id + " directive=" + directive ) ; } }
|
This method needs to change if cache provider supports PMI and CacheStatisticsListener .
| 129
| 16
|
159,270
|
private static String reduceStringLiteralToken ( String image ) { // First, remove leading and trailing ' character image = image . substring ( 1 , image . length ( ) - 1 ) ; // Next, de-double any doubled occurances of the ' character for ( int i = 0 ; i < image . length ( ) ; i ++ ) if ( image . charAt ( i ) == ' ' ) // Here's a ', which we retain, but the character after it, also a ', is elided image = image . substring ( 0 , i + 1 ) + image . substring ( i + 2 ) ; return image ; }
|
processing characters in the image
| 135
| 5
|
159,271
|
static Selector parseIntegerLiteral ( String val ) { // Determine if this is a long constant by checking the suffix char tag = val . charAt ( val . length ( ) - 1 ) ; boolean mustBeLong = false ; if ( tag == ' ' || tag == ' ' ) { val = val . substring ( 0 , val . length ( ) - 1 ) ; mustBeLong = true ; } long longVal = Long . decode ( val ) . longValue ( ) ; if ( mustBeLong || longVal > Integer . MAX_VALUE || longVal < Integer . MIN_VALUE ) return new LiteralImpl ( new Long ( longVal ) ) ; else return new LiteralImpl ( new Integer ( ( int ) longVal ) ) ; }
|
Parse an integer literal
| 161
| 5
|
159,272
|
static Selector parseFloatingLiteral ( String val ) { // Determine if this is a float constant by checking the suffix Number value ; // was NumericValue char tag = val . charAt ( val . length ( ) - 1 ) ; if ( tag == ' ' || tag == ' ' ) value = new Float ( val ) ; else value = new Double ( val ) ; return new LiteralImpl ( value ) ; }
|
Parse a floating point literal
| 91
| 6
|
159,273
|
static Selector convertSet ( Selector expr , List set ) { Selector ans = null ; for ( int i = 0 ; i < set . size ( ) ; i ++ ) { Selector comparand = ( Selector ) set . get ( i ) ; Selector comparison = new OperatorImpl ( Operator . EQ , ( Selector ) expr . clone ( ) , comparand ) ; if ( ans == null ) ans = comparison ; else ans = new OperatorImpl ( Operator . OR , ans , comparison ) ; } return ans ; }
|
Convert a partially parsed set expression into its more primitive form as a disjunction of equalities .
| 112
| 21
|
159,274
|
static Selector convertRange ( Selector expr , Selector bound1 , Selector bound2 ) { return new OperatorImpl ( Operator . AND , new OperatorImpl ( Operator . GE , ( Selector ) expr . clone ( ) , bound1 ) , new OperatorImpl ( Operator . LE , ( Selector ) expr . clone ( ) , bound2 ) ) ; }
|
Convert a partially parsed BETWEEN expression into its more primitive form as a conjunction of inequalities .
| 76
| 20
|
159,275
|
static Selector convertLike ( Selector arg , String pattern , String escape ) { try { pattern = reduceStringLiteralToken ( pattern ) ; boolean escaped = false ; char esc = 0 ; if ( escape != null ) { escape = reduceStringLiteralToken ( escape ) ; if ( escape . length ( ) != 1 ) return null ; escaped = true ; esc = escape . charAt ( 0 ) ; } return Matching . getInstance ( ) . createLikeOperator ( arg , pattern , escaped , esc ) ; } catch ( Exception e ) { // No FFDC Code Needed. // FFDC driven by wrapper class. FFDC . processException ( cclass , "com.ibm.ws.sib.matchspace.selector.impl.ParseUtil.convertLike" , e , "1:183:1.19" ) ; // This should never occur as to get into this we should be missing // the sib.matchspace jar file, but we are already in it. throw new RuntimeException ( e ) ; } }
|
Convert a partially parsed LIKE expression in which the pattern and escape are in the form of token images to the proper Selector expression to represent the LIKE expression
| 226
| 31
|
159,276
|
@ Override public SecurityMetadata getSecurityMetadata ( ) { SecurityMetadata sm = super . getSecurityMetadata ( ) ; if ( sm == null ) { return getDefaultAdminSecurityMetadata ( ) ; } else { return sm ; } }
|
Get the effective SecurityMetadata for this application . First try to defer to the application collaborator to see if the application provides data . If so use it . Otherwise fallback to the default SecurityMetadata .
| 53
| 41
|
159,277
|
private void buildPolicyErrorMessage ( String msgKey , String defaultMessage , Object ... arg1 ) { /* The message need to be logged only for level below 'Warning' */ if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { String messageFromBundle = Tr . formatMessage ( tc , msgKey , arg1 ) ; Tr . error ( tc , messageFromBundle ) ; } }
|
Receives the message key like CSIv2_COMMON_AUTH_LAYER_DISABLED from this key we extract the message from the NLS message bundle which contains the message along with the CWWKS message code .
| 92
| 50
|
159,278
|
public void displaySelectionPage ( HttpServletRequest request , HttpServletResponse response , SocialTaiRequest socialTaiRequest ) throws IOException { setRequestAndConfigInformation ( request , response , socialTaiRequest ) ; if ( selectableConfigs == null || selectableConfigs . isEmpty ( ) ) { sendDisplayError ( response , "SIGN_IN_NO_CONFIGS" , new Object [ 0 ] ) ; return ; } generateOrSendToAppropriateSelectionPage ( response ) ; }
|
Generates the sign in page to allow a user to select from the configured social login services . If no services are configured the user is redirected to an error page .
| 110
| 33
|
159,279
|
String createJavascript ( ) { StringBuilder html = new StringBuilder ( ) ; html . append ( "<script>\n" ) ; html . append ( "function " + createCookieFunctionName + "(value) {\n" ) ; html . append ( "document.cookie = \"" + ClientConstants . LOGIN_HINT + "=\" + value;\n" ) ; html . append ( "}\n" ) ; html . append ( "</script>\n" ) ; return html . toString ( ) ; }
|
Creates a JavaScript function for creating a social_login_hint cookie with the value provided to the function . Each provider button should be configured to call this function when the button is clicked allowing the login hint to be passed around in a cookie instead of a request parameter .
| 115
| 55
|
159,280
|
public boolean parseMessage ( WsByteBuffer buffer , boolean bExtractValue ) throws Exception { final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; boolean rc = false ; if ( ! isFirstLineComplete ( ) ) { if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Parsing First Line" ) ; } rc = parseLine ( buffer ) ; } // if we've read the first line, then parse the headers // Note: we may come in with it true or it might be set to true above if ( isFirstLineComplete ( ) ) { // keep parsing headers until that returns the "finished" response rc = parseHeaders ( buffer , bExtractValue ) ; } if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "parseMessage returning " + rc ) ; } return rc ; }
|
Parse a message from the input buffer . The input flag is whether or not to save the header value immediately or delay the extraction until the header value is queried .
| 196
| 34
|
159,281
|
public WsByteBuffer [ ] marshallMessage ( ) throws MessageSentException { final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; if ( bTrace && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "marshallMessage" ) ; } preMarshallMessage ( ) ; WsByteBuffer [ ] marshalledObj = hasFirstLineChanged ( ) ? marshallLine ( ) : null ; headerComplianceCheck ( ) ; marshalledObj = marshallHeaders ( marshalledObj ) ; postMarshallMessage ( ) ; if ( bTrace && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "marshallMessage" ) ; } return marshalledObj ; }
|
Marshall a message .
| 160
| 5
|
159,282
|
public static URITemplate createTemplate ( Path path , List < Parameter > params , String classNameandPath ) { return createTemplate ( path == null ? null : path . value ( ) , params , classNameandPath ) ; }
|
Liberty Change start
| 51
| 4
|
159,283
|
private boolean isELReserved ( String id ) { int i = 0 ; int j = reservedWords . length ; while ( i < j ) { int k = ( i + j ) / 2 ; int result = reservedWords [ k ] . compareTo ( id ) ; if ( result == 0 ) { return true ; } if ( result < 0 ) { i = k + 1 ; } else { j = k ; } } return false ; }
|
Test if an id is a reserved word in EL
| 94
| 10
|
159,284
|
@ Override protected synchronized Class < ? > loadClass ( String name , boolean resolve ) throws ClassNotFoundException { synchronized ( getClassLoadingLock ( name ) ) { Class < ? > result = null ; if ( name == null || name . length ( ) == 0 ) return null ; result = findLoadedClass ( name ) ; if ( result == null ) { if ( name . regionMatches ( 0 , BootstrapChildFirstJarClassloader . KERNEL_BOOT_CLASS_PREFIX , 0 , BootstrapChildFirstJarClassloader . KERNEL_BOOT_PREFIX_LENGTH ) ) { result = super . loadClass ( name , resolve ) ; } else { try { // Try to load the class from this classpath result = findClass ( name ) ; } catch ( ClassNotFoundException cnfe ) { result = super . loadClass ( name , resolve ) ; } } } return result ; } }
|
Any changes must be made to both sources
| 201
| 8
|
159,285
|
private static List < Integer > allocateOffsets ( List < List < Integer > > offsetsStorage ) { if ( offsetsStorage . isEmpty ( ) ) { return new ArrayList < Integer > ( ) ; } else { return ( offsetsStorage . remove ( 0 ) ) ; } }
|
Allocate an offsets list .
| 58
| 6
|
159,286
|
private static int [ ] releaseOffsets ( List < List < Integer > > offsetsStorage , List < Integer > offsets ) { int numValues = offsets . size ( ) ; int [ ] extractedValues ; if ( numValues == 0 ) { extractedValues = EMPTY_OFFSETS_ARRAY ; } else { extractedValues = new int [ numValues ] ; for ( int valueNo = 0 ; valueNo < numValues ; valueNo ++ ) { extractedValues [ valueNo ] = offsets . get ( valueNo ) . intValue ( ) ; } } offsets . clear ( ) ; offsetsStorage . add ( offsets ) ; return extractedValues ; }
|
Release an offsets list to storage .
| 136
| 7
|
159,287
|
@ Trivial public static ZipEntryData [ ] collectZipEntries ( ZipFile zipFile ) { final List < ZipEntryData > entriesList = new ArrayList < ZipEntryData > ( ) ; final Enumeration < ? extends ZipEntry > zipEntries = zipFile . entries ( ) ; while ( zipEntries . hasMoreElements ( ) ) { entriesList . add ( createZipEntryData ( zipEntries . nextElement ( ) ) ) ; } ZipEntryData [ ] entryData = entriesList . toArray ( new ZipEntryData [ entriesList . size ( ) ] ) ; Arrays . sort ( entryData , ZIP_ENTRY_DATA_COMPARATOR ) ; return entryData ; }
|
Collect data for the entries of a zip file .
| 153
| 10
|
159,288
|
@ Trivial public static Map < String , ZipEntryData > setLocations ( ZipEntryData [ ] entryData ) { Map < String , ZipEntryData > entryDataMap = new HashMap < String , ZipEntryData > ( entryData . length ) ; for ( int entryNo = 0 ; entryNo < entryData . length ; entryNo ++ ) { ZipEntryData entry = entryData [ entryNo ] ; entry . setOffset ( entryNo ) ; entryDataMap . put ( entry . r_path , entry ) ; } return entryDataMap ; }
|
Create a table of entry data using the relative paths of the entries as keys . As a side effect set the offset of each entry data to its location int he entry data array .
| 120
| 36
|
159,289
|
@ Trivial public static int locatePath ( ZipEntryData [ ] entryData , final String r_path ) { ZipEntryData targetData = new SearchZipEntryData ( r_path ) ; // Given: // // 0 gp // 1 gp/p1 // 2 gp/p1/c1 // 3 gp/p2/c2 // // A search for "a" answers "-1" (inexact; insertion point is 0) // A search for "gp" answers "0" (exact) // A search for "gp/p1/c1" answers "2" (exact) // A search for "gp/p1/c0" answers "-3" (inexact; insertion point is 2) // A search for "z" answers "-5" (inexact; insertion point is 4) return Arrays . binarySearch ( entryData , targetData , ZipFileContainerUtils . ZIP_ENTRY_DATA_COMPARATOR ) ; }
|
Locate a path in a collection of entries .
| 211
| 10
|
159,290
|
@ Trivial private static String stripPath ( String path ) { int pathLen = path . length ( ) ; if ( pathLen == 0 ) { return path ; } else if ( pathLen == 1 ) { if ( path . charAt ( 0 ) == ' ' ) { return "" ; } else { return path ; } } else { if ( path . charAt ( 0 ) == ' ' ) { if ( path . charAt ( pathLen - 1 ) == ' ' ) { return path . substring ( 1 , pathLen - 1 ) ; } else { return path . substring ( 1 , pathLen ) ; } } else { if ( path . charAt ( pathLen - 1 ) == ' ' ) { return path . substring ( 0 , pathLen - 1 ) ; } else { return path ; } } } }
|
Paths used in the zip entry table are adjusted to never have a leading slash and to never have a trailing slash .
| 177
| 24
|
159,291
|
private static String getDeepestNestedElementName ( String configDisplayId ) { int start = configDisplayId . lastIndexOf ( "]/" ) ; if ( start > 1 ) { int end = configDisplayId . indexOf ( ' ' , start += 2 ) ; if ( end > start ) return configDisplayId . substring ( start , end ) ; } return null ; }
|
Returns the most deeply nested element name .
| 82
| 8
|
159,292
|
public void dump_memory ( Writer out ) throws IOException { int qlist_num ; out . write ( "First quick size: " + first_quick_size + "\n" ) ; out . write ( "Last quick size: " + last_quick_size + "\n" ) ; out . write ( "Grain size: " + grain_size + "\n" ) ; out . write ( "Acceptable waste: " + acceptable_waste + "\n" ) ; out . write ( "Tail pointer in memory: " + tail_ptr + "\n" ) ; out . write ( "First allocatable byte: " + start ( ) + "\n\n" ) ; out . write ( "Free lists from memory structures\n" ) ; for ( qlist_num = 0 ; qlist_num <= last_ql_index ; qlist_num ++ ) { out . write ( qlist_num + ": " ) ; out . write ( "Length = " + ql_heads [ qlist_num ] . length + "; " ) ; print_memory_freelist ( out , ql_heads [ qlist_num ] . first_block ) ; } ; out . write ( "Nonempty free lists: " + nonempty_lists + "\n" ) ; out . write ( "Tail pointer in memory: " + tail_ptr + "\n" ) ; out . write ( "First allocatable byte: " + start ( ) + "\n\n" ) ; }
|
Outputs storage information stored in main memory . Debugging interface writes interesting stuff to stdout .
| 327
| 19
|
159,293
|
protected Channel createChannel ( ChannelData config ) throws ChannelException { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createChannel" , config ) ; Channel retChannel ; if ( config . isInbound ( ) ) { if ( tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "createChannel" , "inbound" ) ; try { Class clazz = Class . forName ( JFapChannelConstants . INBOUND_CHANNEL_CLASS ) ; Constructor contruct = clazz . getConstructor ( new Class [ ] { ChannelFactoryData . class , ChannelData . class } ) ; retChannel = ( Channel ) contruct . newInstance ( new Object [ ] { channelFactoryData , config } ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.jfapchannel.impl.JFapChannelFactory.createChannel" , JFapChannelConstants . JFAPCHANNELFACT_CREATECHANNEL_01 , this ) ; if ( tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Unable to instantiate inbound channel" , e ) ; // Rethrow as a channel exception throw new ChannelException ( e ) ; } } else { retChannel = new JFapChannelOutbound ( channelFactoryData , config ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createChannel" , retChannel ) ; return retChannel ; }
|
Creates a new channel . Uses channel configuration to determine if the channel should be inbound or outbound .
| 348
| 22
|
159,294
|
public Class [ ] getDeviceInterface ( ) // F177053 { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getDeviceInterface" ) ; // F177053 // Start D232185 if ( devSideInterfaceClasses == null ) { devSideInterfaceClasses = new Class [ 1 ] ; devSideInterfaceClasses [ 0 ] = com . ibm . wsspi . tcpchannel . TCPConnectionContext . class ; // f167363, F184828, F189000 } // End D232185 if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getDeviceInterface" , devSideInterfaceClasses ) ; // F177053 return devSideInterfaceClasses ; }
|
Returns the device side interfaces which our channels can work with . This is always the TCPServiceContext .
| 167
| 22
|
159,295
|
private void addRepository ( String repositoryId , RepositoryWrapper repositoryHolder ) { repositories . put ( repositoryId , repositoryHolder ) ; try { numRepos = getNumberOfRepositories ( ) ; } catch ( WIMException e ) { // okay } }
|
Pair adding to the repositories map and resetting the numRepos int .
| 58
| 16
|
159,296
|
protected String getRepositoryIdByUniqueName ( String uniqueName ) throws WIMException { boolean isDn = UniqueNameHelper . isDN ( uniqueName ) != null ; if ( isDn ) uniqueName = UniqueNameHelper . getValidUniqueName ( uniqueName ) . trim ( ) ; String repo = null ; int repoMatch = - 1 ; int bestMatch = - 1 ; for ( Map . Entry < String , RepositoryWrapper > entry : repositories . entrySet ( ) ) { repoMatch = entry . getValue ( ) . isUniqueNameForRepository ( uniqueName , isDn ) ; if ( repoMatch == Integer . MAX_VALUE ) { return entry . getKey ( ) ; } else if ( repoMatch > bestMatch ) { repo = entry . getKey ( ) ; bestMatch = repoMatch ; } } if ( repo != null ) { return repo ; } AuditManager auditManager = new AuditManager ( ) ; Audit . audit ( Audit . EventID . SECURITY_MEMBER_MGMT_01 , auditManager . getRESTRequest ( ) , auditManager . getRequestType ( ) , auditManager . getRepositoryId ( ) , uniqueName , vmmService . getConfigManager ( ) . getDefaultRealmName ( ) , null , Integer . valueOf ( "204" ) ) ; throw new InvalidUniqueNameException ( WIMMessageKey . ENTITY_NOT_IN_REALM_SCOPE , Tr . formatMessage ( tc , WIMMessageKey . ENTITY_NOT_IN_REALM_SCOPE , WIMMessageHelper . generateMsgParms ( uniqueName , "defined" ) ) ) ; }
|
Returns the id of the repository to which the uniqueName belongs to .
| 357
| 14
|
159,297
|
@ Override public boolean isSameExecutionZone ( FailureScope anotherScope ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "isSameExecutionZone" , anotherScope ) ; boolean isSameZone = equals ( anotherScope ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "isSameExecutionZone" , new Boolean ( isSameZone ) ) ; return isSameZone ; }
|
Returns true if this failure scope represents the same general recovery scope as the input parameter . For instance if more than one FailureScope was created which referenced the same server they would be in the same execution zone .
| 95
| 41
|
159,298
|
public static String encodeCookie ( String string ) { if ( string == null ) { return null ; } string = string . replaceAll ( "%" , "%25" ) ; string = string . replaceAll ( ";" , "%3B" ) ; string = string . replaceAll ( "," , "%2C" ) ; return string ; }
|
Encodes the given string so that it can be used as an HTTP cookie value .
| 73
| 17
|
159,299
|
public static String decodeCookie ( String string ) { if ( string == null ) { return null ; } string = string . replaceAll ( "%2C" , "," ) ; string = string . replaceAll ( "%3B" , ";" ) ; string = string . replaceAll ( "%25" , "%" ) ; return string ; }
|
Decodes the given string from percent encoding .
| 73
| 9
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.