idx
int64 0
41.2k
| question
stringlengths 83
4.15k
| target
stringlengths 5
715
|
|---|---|---|
35,800
|
public RemoteInstanceResult getLogListForServerInstance ( RemoteInstanceDetails indicator , RepositoryPointer after , int offset , int maxRecords , Locale locale ) throws LogRepositoryException { ServerInstanceLogRecordList instance ; if ( after == null ) { instance = logReader . getLogListForServerInstance ( indicator . getStartTime ( ) , indicator . getQuery ( ) ) ; for ( String key : indicator . getProcPath ( ) ) { instance = instance . getChildren ( ) . get ( key ) ; if ( instance == null ) { return new RemoteInstanceResult ( null , null , new HashSet < String > ( ) ) ; } } } else { instance = logReader . getLogListForServerInstance ( after , indicator . getQuery ( ) ) ; } RemoteInstanceResult result ; if ( indicator . getCache ( ) == null ) { result = new RemoteInstanceResult ( instance . getStartTime ( ) , instance . getHeader ( ) , instance . getChildren ( ) . keySet ( ) ) ; } else { result = new RemoteInstanceResult ( null , null , new HashSet < String > ( ) ) ; if ( instance instanceof ServerInstanceLogRecordListImpl ) { ( ( ServerInstanceLogRecordListImpl ) instance ) . setCache ( indicator . getCache ( ) ) ; } } if ( maxRecords != 0 ) { for ( RepositoryLogRecord record : instance . range ( offset , maxRecords ) ) { if ( locale != null && ! locale . toString ( ) . equals ( record . getMessageLocale ( ) ) && record instanceof RepositoryLogRecordImpl ) { RepositoryLogRecordImpl recordImpl = ( RepositoryLogRecordImpl ) record ; recordImpl . setLocalizedMessage ( HpelFormatter . translateMessage ( record , locale ) ) ; recordImpl . setMessageLocale ( locale . toString ( ) ) ; } result . addRecord ( record ) ; } } if ( instance instanceof ServerInstanceLogRecordListImpl && ( indicator . getCache ( ) == null || ! indicator . getCache ( ) . isComplete ( ) ) ) { result . setCache ( ( ( ServerInstanceLogRecordListImpl ) instance ) . getCache ( ) ) ; } return result ; }
|
retrieves records and header for one server instance .
|
35,801
|
public void setValidating ( boolean isValidating ) { if ( isValidating ) MCWrapper . isValidating . set ( true ) ; else MCWrapper . isValidating . remove ( ) ; }
|
Indicates to the connection manager whether validation is occurring on the current thread .
|
35,802
|
public synchronized BrowserProxyQueue createBrowserProxyQueue ( ) throws SIResourceException , SIIncorrectCallException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createBrowserProxyQueue" ) ; checkClosed ( ) ; short id = nextId ( ) ; BrowserProxyQueue proxyQueue = new BrowserProxyQueueImpl ( this , id , conversation ) ; idToProxyQueueMap . put ( new ImmutableId ( id ) , proxyQueue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createBrowserProxyQueue" , proxyQueue ) ; return proxyQueue ; }
|
Creates a new browser proxy queue for this group .
|
35,803
|
public synchronized AsynchConsumerProxyQueue createAsynchConsumerProxyQueue ( OrderingContext oc ) throws SIResourceException , SIIncorrectCallException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createAsynchConsumerProxyQueue" ) ; short id = nextId ( ) ; AsynchConsumerProxyQueue proxyQueue = null ; if ( oc == null ) { proxyQueue = new NonReadAheadSessionProxyQueueImpl ( this , id , conversation ) ; } else { proxyQueue = new OrderedSessionProxyQueueImpl ( this , id , conversation , oc ) ; } idToProxyQueueMap . put ( new ImmutableId ( id ) , proxyQueue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createAsynchConsumerProxyQueue" , proxyQueue ) ; return proxyQueue ; }
|
Creates a new asynchronous consumer proxy queue for this group .
|
35,804
|
public synchronized AsynchConsumerProxyQueue createReadAheadProxyQueue ( Reliability unrecoverableReliability ) throws SIResourceException , SIIncorrectCallException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createReadAheadProxyQueue" ) ; checkClosed ( ) ; short id = nextId ( ) ; AsynchConsumerProxyQueue proxyQueue = new ReadAheadSessionProxyQueueImpl ( this , id , conversation , unrecoverableReliability ) ; idToProxyQueueMap . put ( new ImmutableId ( id ) , proxyQueue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createReadAheadProxyQueue" , proxyQueue ) ; return proxyQueue ; }
|
Creates a new read ahead proxy queue for this group .
|
35,805
|
public synchronized void bury ( ProxyQueue queue ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "bury" ) ; short id = queue . getId ( ) ; mutableId . setValue ( id ) ; idToProxyQueueMap . remove ( mutableId ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "bury" ) ; }
|
If a session is failed to be created then we need to bury it so that it never bothers us again . The queue is simply removed from the conversation group - no attempt is made to remove messages . It is assumed that if something went wrong in the creation then no messages would ever get to the queue .
|
35,806
|
public synchronized ProxyQueue find ( short proxyQueueId ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "find" , "" + proxyQueueId ) ; mutableId . setValue ( proxyQueueId ) ; ProxyQueue retQueue = idToProxyQueueMap . get ( mutableId ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "find" , retQueue ) ; return retQueue ; }
|
Locates a proxy queue from this group via its queue ID .
|
35,807
|
protected void notifyClose ( ProxyQueue queue ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "notifyClose" , queue ) ; try { final short id = queue . getId ( ) ; idAllocator . releaseId ( id ) ; synchronized ( this ) { idToProxyQueueMap . remove ( new ImmutableId ( id ) ) ; } } catch ( IdAllocatorException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".notifyClose" , CommsConstants . PROXYQUEUECONVGROUPIMPL_NOTIFYCLOSE_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( tc , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "notifyClose" ) ; }
|
Notified when a proxy queue in this group is closed . Allows us to free up the ID assigned to it .
|
35,808
|
private short nextId ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "nextId" ) ; short id ; try { id = idAllocator . allocateId ( ) ; } catch ( IdAllocatorException e ) { SIResourceException resourceException = new SIResourceException ( nls . getFormattedMessage ( "MAX_SESSIONS_REACHED_SICO1019" , new Object [ ] { "" + Short . MAX_VALUE } , null ) ) ; resourceException . initCause ( e ) ; throw resourceException ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "nextId" , "" + id ) ; return id ; }
|
Helper method . Returns the next id to be used for a proxy queue .
|
35,809
|
private void checkClosed ( ) throws SIIncorrectCallException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkClosed" , "" + closed ) ; if ( closed ) throw new SIIncorrectCallException ( TraceNLS . getFormattedMessage ( CommsConstants . MSG_BUNDLE , "PROXY_QUEUE_CONVERSATION_GROUP_CLOSED_SICO1059" , null , "PROXY_QUEUE_CONVERSATION_GROUP_CLOSED_SICO1059" ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkClosed" ) ; }
|
Helper method . Checks if this group has been closed and throws an exception if it has .
|
35,810
|
public void close ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" ) ; synchronized ( this ) { if ( closed ) { idToProxyQueueMap . clear ( ) ; factory . groupCloseNotification ( conversation , this ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; }
|
Closes this proxy queue conversation group .
|
35,811
|
public void conversationDroppedNotification ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "conversationDroppedNotification" ) ; LinkedList < ProxyQueue > notifyList = null ; synchronized ( this ) { notifyList = new LinkedList < ProxyQueue > ( ) ; notifyList . addAll ( idToProxyQueueMap . values ( ) ) ; } Iterator iterator = notifyList . iterator ( ) ; while ( iterator . hasNext ( ) ) { ProxyQueue queue = ( ProxyQueue ) iterator . next ( ) ; queue . conversationDroppedNotification ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "conversationDroppedNotification" ) ; }
|
Invoked to notify the group that the conversation that backs it has gone away . Iterate over the queues and notify them .
|
35,812
|
public void setExtraAttribute ( String name , String value ) { if ( extraAttributes == null ) { extraAttributes = new HashMap < QName , Object > ( ) ; } if ( value == null ) { extraAttributes . remove ( new QName ( null , name ) ) ; } else { extraAttributes . put ( new QName ( null , name ) , value ) ; } }
|
Sets an attribute on this element that does not have an explicit setter .
|
35,813
|
public static String getValue ( String value ) { if ( value == null ) { return null ; } String v = removeQuotes ( value . trim ( ) ) . trim ( ) ; if ( v . isEmpty ( ) ) { return null ; } return v ; }
|
Sometimes the JACL representation of a null or empty value includes quotation marks . Calling this method will parse away the extra JACL syntax and return a real or null value
|
35,814
|
public static String removeQuotes ( String arg ) { if ( arg == null ) { return null ; } int length = arg . length ( ) ; if ( length > 1 && arg . startsWith ( "\"" ) && arg . endsWith ( "\"" ) ) { return arg . substring ( 1 , length - 1 ) ; } return arg ; }
|
Removes leading and trailing quotes from the input argument if they exist .
|
35,815
|
protected VirtualConnection processWork ( TCPBaseRequestContext req , int options ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "processWork" ) ; } TCPConnLink conn = req . getTCPConnLink ( ) ; VirtualConnection vc = null ; if ( options != 1 ) { if ( req . isRequestTypeRead ( ) ) { ( ( TCPReadRequestContextImpl ) req ) . setJITAllocateAction ( false ) ; } } if ( attemptIO ( req , false ) ) { vc = conn . getVirtualConnection ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "processWork" ) ; } return vc ; }
|
Processes the request . If the request is already associated with a work queue - send it there . Otherwise round robin requests amongst our set of queues .
|
35,816
|
protected boolean dispatch ( TCPBaseRequestContext req , IOException ioe ) { if ( req . blockedThread ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "dispatcher notifying waiting synch request " ) ; } if ( ioe != null ) { req . blockingIOError = ioe ; } req . blockWait . simpleNotify ( ) ; return true ; } return dispatchWorker ( new Worker ( req , ioe ) ) ; }
|
Dispatches requests to workrer threds or notifies waiting thread .
|
35,817
|
private boolean dispatchWorker ( Worker worker ) { ExecutorService executorService = CHFWBundle . getExecutorService ( ) ; if ( null == executorService ) { if ( FrameworkState . isValid ( ) ) { Tr . error ( tc , "EXECUTOR_SVC_MISSING" ) ; throw new RuntimeException ( "Missing executor service" ) ; } else { return false ; } } executorService . execute ( worker ) ; return true ; }
|
Dispatch a work item .
|
35,818
|
protected void queueConnectForSelector ( ConnectInfo connectInfo ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "queueConnectForSelector" ) ; } try { moveIntoPosition ( connectCount , connect , connectInfo , CS_CONNECTOR ) ; } catch ( IOException x ) { FFDCFilter . processException ( x , getClass ( ) . getName ( ) , "140" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caught IOException...throwing RuntimeException" ) ; } throw new RuntimeException ( x ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "queueConnectForSelector" ) ; } }
|
This method is called when work must be added to the connect selector .
|
35,819
|
protected void createNewThread ( ChannelSelector sr , int threadType , int number ) { StartPrivilegedThread privThread = new StartPrivilegedThread ( sr , threadType , number , this . tGroup ) ; AccessController . doPrivileged ( privThread ) ; }
|
Create a new reader thread . Provided so we can support pulling these from a thread pool in the SyncWorkQueueManager . This will allow these threads to have WSTHreadLocal .
|
35,820
|
void workerRun ( TCPBaseRequestContext req , IOException ioe ) { if ( null == req || req . getTCPConnLink ( ) . isClosed ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Ignoring IO on closed socket: " + req ) ; } return ; } try { if ( ioe == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Worker thread processing IO request: " + req ) ; } attemptIO ( req , true ) ; } else { if ( req . isRequestTypeRead ( ) ) { TCPReadRequestContextImpl readReq = ( TCPReadRequestContextImpl ) req ; if ( readReq . getReadCompletedCallback ( ) != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Worker thread processing read error: " + req . getTCPConnLink ( ) . getSocketIOChannel ( ) . getChannel ( ) ) ; } readReq . getReadCompletedCallback ( ) . error ( readReq . getTCPConnLink ( ) . getVirtualConnection ( ) , readReq , ioe ) ; } } else { TCPWriteRequestContextImpl writeReq = ( TCPWriteRequestContextImpl ) req ; if ( writeReq . getWriteCompletedCallback ( ) != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Worker thread processing write error: " + req ) ; } writeReq . getWriteCompletedCallback ( ) . error ( writeReq . getTCPConnLink ( ) . getVirtualConnection ( ) , writeReq , ioe ) ; } } } } catch ( Throwable t ) { if ( FrameworkState . isValid ( ) ) { FFDCFilter . processException ( t , getClass ( ) . getName ( ) , "workerRun(req)" , new Object [ ] { this , req , ioe } ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Unexpected error in worker; " + t ) ; } } }
|
Main worker thread routine .
|
35,821
|
protected boolean dispatchConnect ( ConnectInfo work ) { if ( work . getSyncObject ( ) != null ) { work . getSyncObject ( ) . simpleNotify ( ) ; return true ; } return dispatchWorker ( new Worker ( work ) ) ; }
|
This is the entry point where work is added to the connect work list . As a result a separate thread from the caller will do the work .
|
35,822
|
public static Map < String , List < String > > getEvaluatedNavigationParameters ( FacesContext facesContext , Map < String , List < String > > parameters ) { Map < String , List < String > > evaluatedParameters = null ; if ( parameters != null && parameters . size ( ) > 0 ) { evaluatedParameters = new HashMap < String , List < String > > ( ) ; for ( Map . Entry < String , List < String > > pair : parameters . entrySet ( ) ) { boolean containsEL = false ; for ( String value : pair . getValue ( ) ) { if ( _isExpression ( value ) ) { containsEL = true ; break ; } } if ( containsEL ) { evaluatedParameters . put ( pair . getKey ( ) , _evaluateValueExpressions ( facesContext , pair . getValue ( ) ) ) ; } else { evaluatedParameters . put ( pair . getKey ( ) , pair . getValue ( ) ) ; } } } else { evaluatedParameters = parameters ; } return evaluatedParameters ; }
|
Evaluate all EL expressions found as parameters and return a map that can be used for redirect or render bookmark links
|
35,823
|
private static List < String > _evaluateValueExpressions ( FacesContext context , List < String > values ) { List < String > target = new ArrayList < String > ( values . size ( ) ) ; for ( String value : values ) { if ( _isExpression ( value ) ) { value = context . getApplication ( ) . evaluateExpressionGet ( context , value , String . class ) ; } target . add ( value ) ; } return target ; }
|
Checks the Strings in the List for EL expressions and evaluates them . Note that the returned List will be a copy of the given List because otherwise it will have unwanted side - effects .
|
35,824
|
public void register ( JMFEncapsulationManager mgr , int id ) { if ( id > JMFPart . MODEL_ID_JMF ) mmmgrTable . put ( Integer . valueOf ( id - 1 ) , mgr ) ; else throw new IllegalArgumentException ( "model ID cannot be negative" ) ; }
|
Register the JMFEncapsulationManager for a particular Model ID .
|
35,825
|
private void registerInternal ( JMFSchema schema ) { schemaTable . set ( ( HashedArray . Element ) schema ) ; Object assoc = schema . getJMFType ( ) . getAssociation ( ) ; if ( assoc != null ) associations . put ( assoc , schema ) ; }
|
Subroutine used by register and registerAll
|
35,826
|
private boolean isPresent ( JMFSchema schema ) throws JMFSchemaIdException { long id = schema . getID ( ) ; JMFSchema reg = ( JMFSchema ) schemaTable . get ( id ) ; if ( reg != null ) { if ( ! schema . equals ( reg ) ) { throw new JMFSchemaIdException ( "Schema id clash: id=" + id ) ; } Object newAssoc = schema . getJMFType ( ) . getAssociation ( ) ; Object oldAssoc = reg . getJMFType ( ) . getAssociation ( ) ; if ( newAssoc != oldAssoc && newAssoc != null ) { if ( oldAssoc != null ) associations . remove ( oldAssoc ) ; reg . getJMFType ( ) . updateAssociations ( schema . getJMFType ( ) ) ; associations . put ( newAssoc , reg ) ; } return true ; } else return false ; }
|
to the same schema .
|
35,827
|
public static Vector getLocales ( HttpServletRequest req ) { init ( ) ; String acceptLanguage = req . getHeader ( "Accept-Language" ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getLocales" , "Accept-Language + acceptLanguage ) ; } if ( ( acceptLanguage == null ) || ( acceptLanguage . trim ( ) . length ( ) == 0 ) ) { Vector def = new Vector ( ) ; def . addElement ( Locale . getDefault ( ) ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getLocales" , "processed Locales , def ) ; } return def ; } Vector langList = null ; langList = ( Vector ) localesCache . get ( acceptLanguage ) ; if ( langList == null ) { langList = processAcceptLanguage ( acceptLanguage ) ; if ( WCCustomProperties . VALIDATE_LOCALE_VALUES ) { langList = extractLocales ( langList , true ) ; } else langList = extractLocales ( langList , false ) ; localesCache . put ( acceptLanguage , langList ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getLocales" , "processed Locales + langList ) ; } return langList ; }
|
Returns a Vector of locales from the passed in request object .
|
35,828
|
public static Vector processAcceptLanguage ( String acceptLanguage ) { init ( ) ; StringTokenizer languageTokenizer = new StringTokenizer ( acceptLanguage , "," ) ; TreeMap map = new TreeMap ( Collections . reverseOrder ( ) ) ; while ( languageTokenizer . hasMoreTokens ( ) ) { String language = languageTokenizer . nextToken ( ) . trim ( ) ; if ( language == null || language . length ( ) == 0 ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "processAcceptLanguage" , "Encountered zero length language token without quality index.. skipping token" ) ; logger . logp ( Level . FINE , CLASS_NAME , "processAcceptLanguage" , "acceptLanguage param = [" + acceptLanguage + "]" ) ; } continue ; } int semicolonIndex = language . indexOf ( ';' ) ; Double qValue = new Double ( 1 ) ; if ( semicolonIndex > - 1 ) { int qIndex = language . indexOf ( "q=" ) ; String qValueStr = language . substring ( qIndex + 2 ) ; try { qValue = new Double ( qValueStr . trim ( ) ) ; } catch ( NumberFormatException nfe ) { com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( nfe , "com.ibm.ws.webcontainer.srt.SRTRequestUtils.processAcceptLanguage" , "215" ) ; } language = language . substring ( 0 , semicolonIndex ) ; } if ( language . length ( ) > 0 ) { if ( ( qValue . doubleValue ( ) > 0 ) && ( language . charAt ( 0 ) != '*' ) ) { Vector newVector = new Vector ( ) ; if ( map . containsKey ( qValue ) ) { newVector = ( Vector ) map . get ( qValue ) ; } newVector . addElement ( language ) ; map . put ( qValue , newVector ) ; } } else { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "processAcceptLanguage" , "Encountered zero length language token with quality index.. skipping token" ) ; logger . logp ( Level . FINE , CLASS_NAME , "processAcceptLanguage" , "acceptLanguage param = [" + acceptLanguage + "]" ) ; } } } if ( map . isEmpty ( ) ) { Vector v = new Vector ( ) ; v . addElement ( Locale . getDefault ( ) . toString ( ) ) ; map . put ( "1" , v ) ; } return new Vector ( map . values ( ) ) ; }
|
Processes the accept languages in a passed in String into a Vector object .
|
35,829
|
public static Vector extractLocales ( Vector languages , boolean secure ) { init ( ) ; Enumeration e = languages . elements ( ) ; Vector l = new Vector ( ) ; while ( e . hasMoreElements ( ) ) { Vector langVector = ( Vector ) e . nextElement ( ) ; Enumeration enumeration = langVector . elements ( ) ; while ( enumeration . hasMoreElements ( ) ) { String language = ( String ) enumeration . nextElement ( ) ; String country = "" ; String variant = "" ; int countryIndex = language . indexOf ( "-" ) ; if ( countryIndex > - 1 ) { country = language . substring ( countryIndex + 1 ) . trim ( ) ; language = language . substring ( 0 , countryIndex ) . trim ( ) ; int variantIndex = country . indexOf ( "-" ) ; if ( variantIndex > - 1 ) { variant = country . substring ( variantIndex + 1 ) . trim ( ) ; country = country . substring ( 0 , variantIndex ) . trim ( ) ; } } if ( secure ) { if ( ( country . trim ( ) . length ( ) != 0 && ! isValueAlphaNumeric ( country , "country" ) ) || ( language . trim ( ) . length ( ) != 0 && ! isValueAlphaNumeric ( language , "language" ) ) ) { language = Locale . getDefault ( ) . getLanguage ( ) ; country = Locale . getDefault ( ) . getCountry ( ) ; variant = "" ; } if ( variant . trim ( ) . length ( ) != 0 && ! isValueAlphaNumeric ( variant , "variant" ) ) { variant = "" ; } } l . addElement ( new Locale ( language , country , variant ) ) ; } } return l ; }
|
This method will validate the values .
|
35,830
|
public static String getEncodingFromLocale ( Locale locale ) { init ( ) ; if ( locale == cachedLocale ) { return cachedEncoding ; } String encoding = null ; if ( encoding == null ) { com . ibm . wsspi . http . EncodingUtils encodingUtils = com . ibm . ws . webcontainer . osgi . WebContainer . getEncodingUtils ( ) ; if ( encodingUtils != null ) { encoding = encodingUtils . getEncodingFromLocale ( locale ) ; } } cachedEncoding = encoding ; cachedLocale = locale ; return encoding ; }
|
Get the encoding for a passed in locale .
|
35,831
|
public static String getJvmConverter ( String encoding ) { init ( ) ; String converter = null ; com . ibm . wsspi . http . EncodingUtils encodingUtils = com . ibm . ws . webcontainer . osgi . WebContainer . getEncodingUtils ( ) ; if ( encodingUtils != null ) { converter = encodingUtils . getJvmConverter ( encoding ) ; } if ( converter != null ) { return converter ; } else { return encoding ; } }
|
Get the JVM Converter for the specified encoding .
|
35,832
|
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
|
35,833
|
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
|
35,834
|
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 .
|
35,835
|
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 .
|
35,836
|
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 .
|
35,837
|
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 .
|
35,838
|
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
|
35,839
|
public boolean preProcess ( ConfigEntry configEntry ) { boolean valid = true ; if ( configEntry . processorData == null ) configEntry . processorData = new Object [ BASE_SLOTS ] ; 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 ) ; } 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
|
35,840
|
public JSConsumerSet getConsumerSet ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getConsumerSet" ) ; SibTr . exit ( tc , "getConsumerSet" , consumerSet ) ; } return consumerSet ; }
|
Returns the consumerSet .
|
35,841
|
public long size ( Transaction transaction ) throws ObjectManagerException { long sizeFound ; synchronized ( this ) { sizeFound = availableSize ; if ( transaction != null ) { Entry entry = firstEntry ( transaction ) ; while ( entry != null ) { if ( entry . state == Entry . stateToBeAdded && entry . lockedBy ( transaction ) ) sizeFound ++ ; entry = successor ( entry , transaction ) ; } } } return sizeFound ; }
|
Returns the number of key - value mappings in this map which ara available to the transaction .
|
35,842
|
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 .
|
35,843
|
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 ) { duplicateSearch : for ( ; ; ) { Entry predecessor = ( Entry ) predecessor ( entry ) ; if ( predecessor == null ) break duplicateSearch ; if ( compare ( key , predecessor . key ) != 0 ) break duplicateSearch ; entry = predecessor ; } } 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 .
|
35,844
|
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 .
|
35,845
|
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 ; keySearch : while ( true ) { if ( compare ( key , currentEntry . key ) < 0 ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , new Object [ ] { "Less than branch." , currentEntry . key } ) ; if ( currentEntry . left == null ) { newEntry = new Entry ( this , key , value , currentEntry , transaction ) ; transaction . add ( newEntry , logSpaceDelta ) ; currentEntry . setLeft ( newEntry ) ; break keySearch ; } currentEntry = ( Entry ) currentEntry . getLeft ( ) ; } else { if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , new Object [ ] { "Greater than branch." , currentEntry . key } ) ; if ( currentEntry . right == null ) { newEntry = new Entry ( this , key , value , currentEntry , transaction ) ; transaction . add ( newEntry , logSpaceDelta ) ; currentEntry . setRight ( newEntry ) ; break keySearch ; } currentEntry = ( Entry ) currentEntry . getRight ( ) ; } } 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 .
|
35,846
|
private void undoPut ( ) throws ObjectManagerException { final String methodName = "undoPut" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName ) ; 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 .
|
35,847
|
public synchronized void clear ( Transaction transaction ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "clear" + "transaction=" + transaction + "(Transaction)" ) ; Entry entry = firstEntry ( transaction ) ; while ( entry != null ) { entry . remove ( transaction ) ; entry = successor ( entry , transaction ) ; } 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 .
|
35,848
|
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 .
|
35,849
|
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 } ) ; managedObjectsToReplace . clear ( ) ; tokensToNotify . clear ( ) ; reservedSpaceInStore = ( int ) storeSpaceForRemove ( ) ; rbDelete ( entry ) ; managedObjectsToReplace . add ( this ) ; tokensToNotify . add ( entry . getToken ( ) ) ; transaction . optimisticReplace ( null , new java . util . ArrayList ( managedObjectsToReplace ) , null , new java . util . ArrayList ( tokensToNotify ) , - logSpaceForDelete ) ; 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 .
|
35,850
|
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 ( ) ; 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 ( ) ) ; 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 .
|
35,851
|
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 ) ; } } catch ( ObjectManagerException objectManagerException ) { printWriter . println ( "Caught objectManagerException=" + objectManagerException ) ; objectManagerException . printStackTrace ( printWriter ) ; } }
|
Print a dump of the Map .
|
35,852
|
public static boolean containsMultipleRoutingContext ( RESTRequest request ) { 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
|
35,853
|
public static String [ ] getRoutingContext ( RESTRequest request , boolean errorIfNull ) { 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 { final String queryStr = request . getQueryString ( ) ; if ( queryStr == null || ! queryStr . contains ( ClientProvider . ROUTING_KEY_HOST_NAME ) ) { if ( errorIfNull ) { throw ErrorHelper . createRESTHandlerJsonException ( new IOException ( "routing context was not present in the request!" ) , null , APIConstants . STATUS_BAD_REQUEST ) ; } return null ; } 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 ] ) ) { routingParams [ 0 ] = URLDecoder ( queryParts [ i + 1 ] , null ) ; i ++ ; continue ; } else if ( ClientProvider . ROUTING_KEY_SERVER_USER_DIR . equals ( queryParts [ i ] ) ) { routingParams [ 1 ] = URLDecoder ( queryParts [ i + 1 ] , null ) ; i ++ ; continue ; } else if ( ClientProvider . ROUTING_KEY_SERVER_NAME . equals ( queryParts [ i ] ) ) { routingParams [ 2 ] = URLDecoder ( queryParts [ i + 1 ] , null ) ; 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 .
|
35,854
|
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
|
35,855
|
public static Converter findUIOutputConverter ( FacesContext facesContext , UIOutput component ) throws FacesException { return _SharedRendererUtils . findUIOutputConverter ( facesContext , component ) ; }
|
Find the proper Converter for the given UIOutput component .
|
35,856
|
public static Converter findUISelectManyConverter ( FacesContext facesContext , UISelectMany component ) { return findUISelectManyConverter ( facesContext , component , false ) ; }
|
Calls findUISelectManyConverter with considerValueType = false .
|
35,857
|
public static Converter findUISelectManyConverter ( FacesContext facesContext , UISelectMany component , boolean considerValueType ) { Converter converter = component . getConverter ( ) ; if ( converter != null ) { return converter ; } if ( considerValueType ) { converter = _SharedRendererUtils . getValueTypeConverter ( facesContext , component ) ; if ( converter != null ) { return converter ; } } ValueExpression ve = component . getValueExpression ( "value" ) ; if ( ve == null ) { return null ; } Class < ? > valueType = null ; Object value = ve . getValue ( facesContext . getELContext ( ) ) ; valueType = ( value != null ) ? value . getClass ( ) : ve . getType ( facesContext . getELContext ( ) ) ; if ( valueType == null ) { return null ; } if ( Collection . class . isAssignableFrom ( valueType ) || Object . class . equals ( valueType ) ) { 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 ; } if ( Object . class . equals ( arrayComponentType ) ) { 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 .
|
35,858
|
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 .
|
35,859
|
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 .
|
35,860
|
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 .
|
35,861
|
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 .
|
35,862
|
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 .
|
35,863
|
public static ResponseStateManager getResponseStateManager ( FacesContext facesContext , String renderKitId ) throws FacesException { RenderKit renderKit = facesContext . getRenderKit ( ) ; if ( renderKit == null ) { 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
|
35,864
|
static public String toResourceUri ( FacesContext facesContext , Object o ) { if ( o == null ) { return null ; } String uri = o . toString ( ) ; if ( uri . length ( ) == 0 ) { return null ; } if ( uri . contains ( ResourceHandler . RESOURCE_IDENTIFIER ) ) { return uri ; } if ( uri . startsWith ( "//" ) ) { return uri . substring ( 1 ) ; } else { String resourceURL = facesContext . getApplication ( ) . getViewHandler ( ) . getResourceURL ( facesContext , uri ) ; return facesContext . getExternalContext ( ) . encodeResourceURL ( resourceURL ) ; } }
|
Coerces an object into a resource URI calling the view - handler .
|
35,865
|
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,866
|
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 .
|
35,867
|
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 ) { 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
|
35,868
|
private static String discoverClassName ( ClassLoader tccl ) { String className = null ; className = getClassNameServices ( tccl ) ; if ( className == null ) { if ( IS_SECURITY_ENABLED ) { className = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { public String run ( ) { return getClassNameJreDir ( ) ; } } ) ; } else { className = getClassNameJreDir ( ) ; } } if ( className == null ) { if ( IS_SECURITY_ENABLED ) { className = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { public String run ( ) { return getClassNameSysProp ( ) ; } } ) ; } else { className = getClassNameSysProp ( ) ; } } if ( className == null ) { className = "org.apache.el.ExpressionFactoryImpl" ; } return className ; }
|
Discover the name of class that implements ExpressionFactory .
|
35,869
|
private static void addBundleManifestRequireCapability ( FileSystem zipSystem , Path bundle , Map < Path , String > requiresMap ) throws IOException { Path extractedJar = null ; try { 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
|
35,870
|
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
|
35,871
|
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 .
|
35,872
|
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
|
35,873
|
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,874
|
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 .
|
35,875
|
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 .
|
35,876
|
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 ) ) { 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
|
35,877
|
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 .
|
35,878
|
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 .
|
35,879
|
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 .
|
35,880
|
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 .
|
35,881
|
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 .
|
35,882
|
static public InterceptorMetaData createInterceptorMetaData ( EJBMDOrchestrator ejbMDOrchestrator , BeanMetaData bmd , final Map < Method , ArrayList < EJBMethodInfoImpl > > methodInfoMap ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "createInterceptorMetaData" ) ; } EJBModuleMetaDataImpl mmd = ( EJBModuleMetaDataImpl ) bmd . getModuleMetaData ( ) ; InterceptorMetaDataFactory factory = new InterceptorMetaDataFactory ( mmd , bmd ) ; factory . ivEJBMethodInfoMap = methodInfoMap ; if ( factory . ivInterceptorBinding != null ) { factory . validateInterceptorBindings ( ) ; } factory . setExcludeDefaultInterceptors ( ) ; factory . addDefaultInterceptors ( ) ; factory . addClassLevelInterceptors ( ) ; factory . ivClassInterceptorOrder = factory . orderClassLevelInterceptors ( ) ; factory . addJCDIInterceptors ( ) ; factory . processBeanInterceptors ( ) ; factory . updateEJBMethodInfoInterceptorProxies ( ) ; InterceptorProxy [ ] postConstructProxies = factory . getInterceptorProxies ( InterceptorMethodKind . POST_CONSTRUCT , factory . ivClassInterceptorOrder ) ; InterceptorProxy [ ] preDestroyProxies = factory . getInterceptorProxies ( InterceptorMethodKind . PRE_DESTROY , factory . ivClassInterceptorOrder ) ; InterceptorProxy [ ] prePassivateProxies = factory . getInterceptorProxies ( InterceptorMethodKind . PRE_PASSIVATE , factory . ivClassInterceptorOrder ) ; InterceptorProxy [ ] postActivateProxies = factory . getInterceptorProxies ( InterceptorMethodKind . POST_ACTIVATE , factory . ivClassInterceptorOrder ) ; InterceptorProxy [ ] aroundConstructProxies = factory . getInterceptorProxies ( InterceptorMethodKind . AROUND_CONSTRUCT , factory . ivClassInterceptorOrder ) ; InterceptorMetaData imd = null ; if ( ! factory . ivBeanInterceptorProxyMap . isEmpty ( ) || ! factory . ivInterceptorClasses . isEmpty ( ) ) { Class < ? > [ ] classes = factory . ivInterceptorClasses . toArray ( new Class < ? > [ 0 ] ) ; ManagedObjectFactory < ? > [ ] managedObjectFactories = null ; for ( int i = 0 ; i < classes . length ; i ++ ) { ManagedObjectFactory < ? > managedObjectFactory = ejbMDOrchestrator . getInterceptorManagedObjectFactory ( bmd , classes [ i ] ) ; if ( managedObjectFactory != null ) { if ( managedObjectFactories == null ) { managedObjectFactories = new ManagedObjectFactory [ classes . length ] ; } managedObjectFactories [ i ] = managedObjectFactory ; } } imd = new InterceptorMetaData ( classes , managedObjectFactories , aroundConstructProxies , postConstructProxies , postActivateProxies , prePassivateProxies , preDestroyProxies , factory . ivBeanLifecycleMethods ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "createInterceptorMetaData returning: " + imd ) ; } return imd ; }
|
Create InterceptorMetaData instance to use for a specified EJB module and bean meta data object . Also update EJBMethodInfoImpl object with method level interceptor data as needed .
|
35,883
|
private void addJCDIInterceptors ( ) { JCDIHelper jcdiHelper = ivEJBModuleMetaDataImpl . ivJCDIHelper ; if ( jcdiHelper != null && ! ivBmd . isManagedBean ( ) ) { 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 ) ; } 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
|
35,884
|
private List < String > addLoadedInterceptorClasses ( Class < ? > [ ] classes ) { 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 .
|
35,885
|
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 ( ) ) ; } ArrayList < String > interceptorNames = new ArrayList < String > ( ) ; if ( ! ivMetadataComplete ) { 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 ) ; } List < String > names = addLoadedInterceptorClasses ( methodLevelInterceptors . value ( ) ) ; interceptorNames . addAll ( names ) ; } } if ( methodBinding != null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "processing interceptor binding for method: " + method ) ; } List < String > names = methodBinding . ivInterceptorClassNames ; updateNamesToClassMap ( names ) ; interceptorNames . addAll ( names ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addMethodLevelInterceptors: " + interceptorNames ) ; } return interceptorNames ; }
|
d367572 . 9 updated for xml and metadata - complete .
|
35,886
|
private void updateEJBMethodInfoInterceptorProxies ( ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "updateEJBMethodInfoInterceptorProxies: " + ivEjbName ) ; } for ( Map . Entry < Method , ArrayList < EJBMethodInfoImpl > > entry : ivEJBMethodInfoMap . entrySet ( ) ) { InterceptorProxy [ ] proxies = getAroundInterceptorProxies ( InterceptorMethodKind . AROUND_INVOKE , entry . getKey ( ) ) ; if ( proxies != null ) { for ( EJBMethodInfoImpl info : entry . getValue ( ) ) { info . setAroundInterceptorProxies ( proxies ) ; } } } if ( ivBmd . timedMethodInfos != null ) { for ( EJBMethodInfoImpl info : ivBmd . timedMethodInfos ) { InterceptorProxy [ ] proxies = getAroundInterceptorProxies ( InterceptorMethodKind . AROUND_TIMEOUT , info . getMethod ( ) ) ; if ( proxies != null ) { info . setAroundInterceptorProxies ( proxies ) ; } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "updateEJBMethodInfoInterceptorProxies: " + ivJ2EEName ) ; } }
|
d367572 . 9 updated for xml
|
35,887
|
private InterceptorProxy [ ] getAroundInterceptorProxies ( InterceptorMethodKind kind , Method m ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getAroundInterceptorProxies: " + kind + ", " + m ) ; } List < String > orderedList = orderMethodLevelInterceptors ( m ) ; InterceptorProxy [ ] proxies = getInterceptorProxies ( kind , orderedList ) ; 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 .
|
35,888
|
private void processBeanInterceptors ( ) throws EJBConfigurationException { ivBeanInterceptorProxyMap = createInterceptorProxyMap ( ivEjbClass , - 1 ) ; 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 .
|
35,889
|
private InterceptorProxy [ ] getInterceptorProxies ( InterceptorMethodKind kind , List < String > orderedList ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getInterceptorProxies: " + kind + ", " + orderedList ) ; } List < InterceptorProxy > proxyList = new ArrayList < InterceptorProxy > ( ) ; for ( String name : orderedList ) { Class < ? > klass = ivInterceptorNameToClassMap . get ( name ) ; Map < InterceptorMethodKind , List < InterceptorProxy > > proxyMap = ivInterceptorProxyMaps . get ( klass ) ; if ( proxyMap == null ) { int index = ivInterceptorClasses . size ( ) ; ivInterceptorClasses . add ( klass ) ; proxyMap = createInterceptorProxyMap ( klass , index ) ; ivInterceptorProxyMaps . put ( klass , proxyMap ) ; } List < InterceptorProxy > kindProxyList = proxyMap . get ( kind ) ; if ( kindProxyList != null ) { proxyList . addAll ( kindProxyList ) ; } } if ( ivJCDIFirstInterceptorClass != null ) { Map < InterceptorMethodKind , List < InterceptorProxy > > proxyMap = ivInterceptorProxyMaps . get ( ivJCDIFirstInterceptorClass ) ; if ( proxyMap == null ) { int index = ivInterceptorClasses . size ( ) ; ivInterceptorClasses . add ( ivJCDIFirstInterceptorClass ) ; proxyMap = createInterceptorProxyMap ( ivJCDIFirstInterceptorClass , index ) ; ivInterceptorProxyMaps . put ( ivJCDIFirstInterceptorClass , proxyMap ) ; } List < InterceptorProxy > kindProxyList = proxyMap . get ( kind ) ; if ( kindProxyList != null ) { proxyList . addAll ( 0 , kindProxyList ) ; } } if ( ivJCDILastInterceptorClass != null ) { Map < InterceptorMethodKind , List < InterceptorProxy > > proxyMap = ivInterceptorProxyMaps . get ( ivJCDILastInterceptorClass ) ; if ( proxyMap == null ) { int index = ivInterceptorClasses . size ( ) ; ivInterceptorClasses . add ( ivJCDILastInterceptorClass ) ; proxyMap = createInterceptorProxyMap ( ivJCDILastInterceptorClass , index ) ; ivInterceptorProxyMaps . put ( ivJCDILastInterceptorClass , proxyMap ) ; } List < InterceptorProxy > kindProxyList = proxyMap . get ( kind ) ; if ( kindProxyList != null ) { proxyList . addAll ( kindProxyList ) ; } } List < InterceptorProxy > kindProxyList = ivBeanInterceptorProxyMap . get ( kind ) ; if ( kindProxyList != null ) { proxyList . addAll ( kindProxyList ) ; } InterceptorProxy [ ] proxies ; if ( proxyList . isEmpty ( ) ) { proxies = null ; } else { proxies = new InterceptorProxy [ proxyList . size ( ) ] ; proxyList . toArray ( proxies ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getInterceptorProxies: " + Arrays . toString ( proxies ) ) ; } return proxies ; }
|
Gets an ordered list of interceptor proxies of the specified kind . processBeanInterceptors must have been called prior to calling this method .
|
35,890
|
private void validateEJBCallbackMethod ( InterceptorMethodKind actualKind , Method m , boolean annotation ) throws EJBConfigurationException { String methodName = m . getName ( ) ; InterceptorMethodKind requiredKind = mapEjbCallbackName ( methodName ) ; if ( requiredKind != null && actualKind != requiredKind ) { String ejbClassName = ivEjbClass . getName ( ) ; String required = mapInterceptorMethodKind ( requiredKind , true , annotation ) ; String actual = mapInterceptorMethodKind ( actualKind , false , annotation ) ; StringBuilder sb = new StringBuilder ( ) ; if ( ivMDB ) { sb . append ( "CNTR0243E: Because the " ) . append ( ejbClassName ) ; sb . append ( " enterprise bean implements the javax.ejb.MessageDriven interface, the " ) ; sb . append ( methodName ) . append ( " method must be a " ) . append ( required ) ; sb . append ( " method and not a " ) . append ( actual ) . append ( " method." ) ; Tr . error ( tc , "INVALID_MDB_CALLBACK_METHOD_CNTR0243E" , new Object [ ] { ejbClassName , methodName , required , actual } ) ; } else if ( ivSLSB ) { sb . append ( "CNTR0241E: Because the " ) . append ( ejbClassName ) ; sb . append ( " enterprise bean implements the javax.ejb.SessionBean interface, the " ) ; sb . append ( methodName ) . append ( " method must be a " ) . append ( required ) ; sb . append ( " method and not a " ) . append ( actual ) . append ( " method." ) ; Tr . error ( tc , "INVALID_SLSB_CALLBACK_METHOD_CNTR0241E" , new Object [ ] { ejbClassName , methodName , required , actual } ) ; } else if ( ivSFSB ) { sb . append ( "CNTR0242E: Because the " ) . append ( ejbClassName ) ; sb . append ( " enterprise bean implements the javax.ejb.SessionBean interface, the " ) ; sb . append ( methodName ) . append ( " method must be a " ) . append ( required ) ; sb . append ( " method and not a " ) . append ( actual ) . append ( " method." ) ; Tr . error ( tc , "INVALID_SFSB_CALLBACK_METHOD_CNTR0242E" , new Object [ ] { ejbClassName , methodName , required , actual } ) ; } throw new EJBConfigurationException ( sb . toString ( ) ) ; } }
|
d463727 entire method added .
|
35,891
|
private ArrayList < String > orderClassLevelInterceptors ( ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "orderClassLevelInterceptors" ) ; } ArrayList < String > orderedList = new ArrayList < String > ( ) ; if ( ivExcludeDefaultFromClassLevel == false ) { if ( ivDefaultInterceptorNames . size ( ) > 0 ) { orderedList . addAll ( ivDefaultInterceptorNames ) ; } } if ( ivClassInterceptorNames . size ( ) > 0 ) { orderedList . addAll ( ivClassInterceptorNames ) ; } if ( ivClassInterceptorBinding != null ) { List < String > order = ivClassInterceptorBinding . ivInterceptorOrder ; if ( ! order . isEmpty ( ) ) { ArrayList < String > interceptorOrder = new ArrayList < String > ( order ) ; if ( interceptorOrder . containsAll ( orderedList ) ) { orderedList = interceptorOrder ; } else { 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 ) ; } } } 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 .
|
35,892
|
private ArrayList < String > orderMethodLevelInterceptors ( Method m ) throws EJBConfigurationException { ArrayList < String > orderedList = new ArrayList < String > ( ) ; EJBInterceptorBinding binding = findInterceptorBindingForMethod ( m ) ; boolean excludeClassInterceptors = isClassInterceptorsExcluded ( m , binding ) ; boolean excludeDefaultInterceptors = isDefaultInterceptorsExcluded ( m , binding ) ; ArrayList < String > interceptors = addMethodLevelInterceptors ( m , binding ) ; if ( ! excludeClassInterceptors && excludeDefaultInterceptors == ivExcludeDefaultFromClassLevel ) { orderedList . addAll ( ivClassInterceptorOrder ) ; } else { if ( ! excludeDefaultInterceptors ) { orderedList . addAll ( ivDefaultInterceptorNames ) ; } if ( ! excludeClassInterceptors ) { orderedList . addAll ( ivClassInterceptorNames ) ; } } orderedList . addAll ( interceptors ) ; if ( binding != null && ! binding . ivInterceptorOrder . isEmpty ( ) ) { List < String > order = binding . ivInterceptorOrder ; updateNamesToClassMap ( order ) ; ArrayList < String > interceptorOrder = new ArrayList < String > ( order ) ; if ( interceptorOrder . containsAll ( orderedList ) ) { orderedList = interceptorOrder ; } else { List < String > missingList ; if ( interceptorOrder . size ( ) < orderedList . size ( ) ) { orderedList . removeAll ( interceptorOrder ) ; missingList = orderedList ; } else { interceptorOrder . removeAll ( orderedList ) ; missingList = interceptorOrder ; } String ejbName = ivJ2EEName . toString ( ) ; String methodName = m . getName ( ) ; Object [ ] data = new Object [ ] { ejbName , methodName , order , missingList } ; Tr . warning ( tc , "PARTIAL_METHOD_INTERCEPTOR_ORDER_CNTR0228E" , data ) ; throw new EJBConfigurationException ( order + " is not a total ordering of method-level interceptors for method " + methodName + " of EJB " + ejbName + ". It is missing interceptor names: " + missingList ) ; } } return orderedList ; }
|
Get an ordered list of method level interceptors for specified method of an EJB .
|
35,893
|
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 .
|
35,894
|
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 .
|
35,895
|
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 .
|
35,896
|
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 .
|
35,897
|
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 .
|
35,898
|
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 .
|
35,899
|
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 .
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.