idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
164,200
public synchronized ConversationImpl get ( int id ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "get" , "" + id ) ; mutableKey . setValue ( id ) ; ConversationImpl retValue = idToConvTable . get ( mutableKey ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "get" , retValue ) ; return retValue ; }
Retrieve a conversation from the table by ID
164,201
public synchronized boolean remove ( int id ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "remove" , "" + id ) ; final boolean result = contains ( id ) ; if ( result ) { mutableKey . setValue ( id ) ; idToConvTable . remove ( mutableKey ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "remove" , "" + result ) ; return result ; }
Remove a conversation from the table by ID
164,202
public synchronized Iterator iterator ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "iterator" ) ; Iterator returnValue = idToConvTable . values ( ) . iterator ( ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "iterator" , returnValue ) ; return returnValue ; }
Returns an iterator which iterates over the tables contents . The values returned by this iterator are objects of type Conversation .
164,203
public static TxXATerminator instance ( String providerId ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "instance" , providerId ) ; final TxXATerminator xat ; synchronized ( _txXATerminators ) { if ( _txXATerminators . containsKey ( providerId ) ) { xat = ( TxXATerminator ) _txXATerminators . get ( providerId ) ; } else { xat = new TxXATerminator ( providerId ) ; _txXATerminators . put ( providerId , xat ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "instance" , xat ) ; return xat ; }
Return the TxXATerminator instance specific to the given providerId
164,204
protected JCATranWrapper getTxWrapper ( Xid xid , boolean addAssociation ) throws XAException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getTxWrapper" , xid ) ; final JCATranWrapper txWrapper = TxExecutionContextHandler . getTxWrapper ( xid , addAssociation ) ; if ( txWrapper . getTransaction ( ) == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getTxWrapper" , "no transaction was found for the specified XID" ) ; throw new XAException ( XAException . XAER_NOTA ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getTxWrapper" , txWrapper ) ; return txWrapper ; }
Gets the Transaction from the TxExecutionContextHandler that imported it
164,205
private String getMethod ( ELNode . Function func ) throws JspTranslationException { FunctionInfo funcInfo = func . getFunctionInfo ( ) ; String signature = funcInfo . getFunctionSignature ( ) ; int start = signature . indexOf ( ' ' ) ; if ( start < 0 ) { throw new JspTranslationException ( "jsp.error.tld.fn.invalid.signature " + func . getPrefix ( ) + " " + func . getName ( ) ) ; } int end = signature . indexOf ( '(' ) ; if ( end < 0 ) { throw new JspTranslationException ( "jsp.error.tld.fn.invalid.signature.parenexpected " + func . getPrefix ( ) + " " + func . getName ( ) ) ; } return signature . substring ( start + 1 , end ) . trim ( ) ; }
Get the method name from the signature .
164,206
public boolean exists ( String index ) { boolean exists = false ; if ( indexNames . isEmpty ( ) == false ) { for ( i = 0 ; i < indexNames . size ( ) ; i ++ ) { if ( index . equals ( ( String ) indexNames . elementAt ( i ) ) ) { exists = true ; break ; } } } return exists ; }
see if the passed in index exists in the vector
164,207
private void _createEagerBeans ( FacesContext facesContext ) { ExternalContext externalContext = facesContext . getExternalContext ( ) ; RuntimeConfig runtimeConfig = RuntimeConfig . getCurrentInstance ( externalContext ) ; List < ManagedBean > eagerBeans = new ArrayList < ManagedBean > ( ) ; for ( ManagedBean bean : runtimeConfig . getManagedBeans ( ) . values ( ) ) { String eager = bean . getEager ( ) ; if ( eager != null && "true" . equals ( eager ) ) { if ( ManagedBeanBuilder . APPLICATION . equals ( bean . getManagedBeanScope ( ) ) ) { eagerBeans . add ( bean ) ; } else { log . log ( Level . WARNING , "The managed-bean with name " + bean . getManagedBeanName ( ) + " must be application scoped to support eager=true." ) ; } } } if ( ! eagerBeans . isEmpty ( ) ) { ManagedBeanBuilder managedBeanBuilder = new ManagedBeanBuilder ( ) ; Map < String , Object > applicationMap = externalContext . getApplicationMap ( ) ; for ( ManagedBean bean : eagerBeans ) { if ( applicationMap . containsKey ( bean . getManagedBeanName ( ) ) ) { continue ; } Object beanInstance = managedBeanBuilder . buildManagedBean ( facesContext , bean ) ; applicationMap . put ( bean . getManagedBeanName ( ) , beanInstance ) ; } } }
Checks for application scoped managed - beans with eager = true creates them and stores them in the application map .
164,208
protected static ExpressionFactory loadExpressionFactory ( String expressionFactoryClassName ) { try { Class < ? > expressionFactoryClass = Class . forName ( expressionFactoryClassName ) ; return ( ExpressionFactory ) expressionFactoryClass . newInstance ( ) ; } catch ( Exception ex ) { if ( log . isLoggable ( Level . FINE ) ) { log . log ( Level . FINE , "An error occured while instantiating a new ExpressionFactory. " + "Attempted to load class '" + expressionFactoryClassName + "'." , ex ) ; } } return null ; }
Loads and instantiates the given ExpressionFactory implementation .
164,209
protected void initCDIIntegration ( ServletContext servletContext , ExternalContext externalContext ) { Object beanManager = servletContext . getAttribute ( CDI_SERVLET_CONTEXT_BEAN_MANAGER_ATTRIBUTE ) ; if ( beanManager == null ) { Class icclazz = null ; Method lookupMethod = null ; try { icclazz = ClassUtils . simpleClassForName ( "javax.naming.InitialContext" ) ; if ( icclazz != null ) { lookupMethod = icclazz . getMethod ( "doLookup" , String . class ) ; } } catch ( Throwable t ) { } if ( lookupMethod != null ) { try { beanManager = lookupMethod . invoke ( icclazz , "java:comp/BeanManager" ) ; } catch ( Exception e ) { } catch ( NoClassDefFoundError e ) { } if ( beanManager == null ) { try { beanManager = lookupMethod . invoke ( icclazz , "java:comp/env/BeanManager" ) ; } catch ( Exception e ) { } catch ( NoClassDefFoundError e ) { } } } } if ( beanManager != null ) { externalContext . getApplicationMap ( ) . put ( CDI_BEAN_MANAGER_INSTANCE , beanManager ) ; } }
The intention of this method is provide a point where CDI integration is done . Faces Flow and javax . faces . view . ViewScope requires CDI in order to work so this method should set a BeanManager instance on application map under the key oam . cdi . BEAN_MANAGER_INSTANCE . The default implementation look on ServletContext first and then use JNDI .
164,210
ThreadGroup getThreadGroup ( String identifier , String threadFactoryName , ThreadGroup parentGroup ) { ConcurrentHashMap < String , ThreadGroup > threadFactoryToThreadGroup = metadataIdentifierToThreadGroups . get ( identifier ) ; if ( threadFactoryToThreadGroup == null ) if ( metadataIdentifierService . isMetaDataAvailable ( identifier ) ) { threadFactoryToThreadGroup = new ConcurrentHashMap < String , ThreadGroup > ( ) ; ConcurrentHashMap < String , ThreadGroup > added = metadataIdentifierToThreadGroups . putIfAbsent ( identifier , threadFactoryToThreadGroup ) ; if ( added != null ) threadFactoryToThreadGroup = added ; } else throw new IllegalStateException ( identifier . toString ( ) ) ; ThreadGroup group = threadFactoryToThreadGroup . get ( threadFactoryName ) ; if ( group == null ) group = AccessController . doPrivileged ( new CreateThreadGroupIfAbsentAction ( parentGroup , threadFactoryName , identifier , threadFactoryToThreadGroup ) , serverAccessControlContext ) ; return group ; }
Returns the thread group to use for the specified application component .
164,211
void threadFactoryDestroyed ( String threadFactoryName , ThreadGroup parentGroup ) { Collection < ThreadGroup > groupsToDestroy = new LinkedList < ThreadGroup > ( ) ; for ( ConcurrentHashMap < String , ThreadGroup > threadFactoryToThreadGroup : metadataIdentifierToThreadGroups . values ( ) ) { ThreadGroup group = threadFactoryToThreadGroup . remove ( threadFactoryName ) ; if ( group != null ) groupsToDestroy . add ( group ) ; } groupsToDestroy . add ( parentGroup ) ; AccessController . doPrivileged ( new InterruptAndDestroyThreadGroups ( groupsToDestroy , deferrableScheduledExecutor ) , serverAccessControlContext ) ; }
Invoke this method when destroying a ManagedThreadFactory in order to interrupt all managed threads that it created .
164,212
protected void createRealizationAndState ( MessageProcessor messageProcessor , TransactionCommon transaction ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createRealizationAndState" , new Object [ ] { messageProcessor , transaction } ) ; _ptoPRealization = new LinkState ( this , messageProcessor , getLocalisationManager ( ) ) ; _protoRealization = _ptoPRealization ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createRealizationAndState" ) ; }
Cold start version of State Handler creation .
164,213
protected void reconstitute ( MessageProcessor processor , HashMap durableSubscriptionsTable , int startMode ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reconstitute" , new Object [ ] { processor , durableSubscriptionsTable , new Integer ( startMode ) } ) ; getLocalisationManager ( ) . setMessageProcessor ( processor ) ; super . reconstitute ( processor , durableSubscriptionsTable , startMode ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" ) ; }
Overide the reconstitute method so we can set the message processor instance as this will have been done by the cursor . next method .
164,214
synchronized private void _put ( String componentFamily , String rendererType , Renderer renderer ) { Map < String , Renderer > familyRendererMap = _renderers . get ( componentFamily ) ; if ( familyRendererMap == null ) { familyRendererMap = new ConcurrentHashMap < String , Renderer > ( 8 , 0.75f , 1 ) ; _renderers . put ( componentFamily , familyRendererMap ) ; } else { if ( familyRendererMap . get ( rendererType ) != null ) { log . fine ( "Overwriting renderer with family = " + componentFamily + " rendererType = " + rendererType + " renderer class = " + renderer . getClass ( ) . getName ( ) ) ; } } familyRendererMap . put ( rendererType , renderer ) ; }
Put the renderer on the double map
164,215
public Object get ( Object key ) { NonSyncHashtableEntry tab [ ] = table ; int hash = key . hashCode ( ) ; int index = ( hash & 0x7FFFFFFF ) % tab . length ; for ( NonSyncHashtableEntry e = tab [ index ] ; e != null ; e = e . next ) { if ( ( e . hash == hash ) && e . key . equals ( key ) ) { return e . value ; } } return null ; }
Returns the value to which the specified key is mapped in this hashtable .
164,216
public void write ( Writer out , ELContext ctx ) throws ELException , IOException { out . write ( this . literal ) ; }
Allow this instance to write to the passed Writer given the ELContext state
164,217
public Object provideCacheable ( Object key ) { if ( tc . isDebugEnabled ( ) ) tc . debug ( this , cclass , "provideCacheable" , key ) ; return null ; }
Cache methods do nothing for this type
164,218
void setMatcher ( ContentMatcher m ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "setMatcher" , "matcher: " + m + ", hasContent: " + new Boolean ( hasContent ) ) ; wildMatchers . add ( m ) ; this . hasContent |= m . hasTests ( ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "setMatcher" ) ; }
Caches a matcher
164,219
ContentMatcher [ ] getMatchers ( ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "getMatchers" ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "getMatchers" ) ; return ( ContentMatcher [ ] ) wildMatchers . toArray ( new ContentMatcher [ 0 ] ) ; }
Returns the Matcher cache as an array
164,220
public ManagedObject get ( Token token ) throws ObjectManagerException { final String methodName = "get" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) { trace . entry ( this , cclass , methodName , token ) ; trace . exit ( this , cclass , methodName ) ; } throw new InMemoryObjectNotAvailableException ( this , token ) ; }
Always throws InMemoryObjectNotAvailableException .
164,221
public static AccessLog . Format convertNCSAFormat ( String name ) { if ( null == name ) { return AccessLog . Format . COMMON ; } AccessLog . Format format = AccessLog . Format . COMMON ; String test = name . trim ( ) . toLowerCase ( ) ; if ( "combined" . equals ( test ) ) { format = AccessLog . Format . COMBINED ; } return format ; }
Convert the input string into the appropriate Format setting .
164,222
public static DebugLog . Level convertDebugLevel ( String name ) { if ( null == name ) { return DebugLog . Level . NONE ; } DebugLog . Level level = DebugLog . Level . WARN ; String test = name . trim ( ) . toLowerCase ( ) ; if ( "none" . equals ( test ) ) { level = DebugLog . Level . NONE ; } else if ( "error" . equals ( test ) ) { level = DebugLog . Level . ERROR ; } else if ( "debug" . equals ( test ) ) { level = DebugLog . Level . DEBUG ; } else if ( "crit" . equals ( test ) || "critical" . equals ( test ) ) { level = DebugLog . Level . CRIT ; } else if ( "info" . equals ( test ) || "information" . equals ( test ) ) { level = DebugLog . Level . INFO ; } return level ; }
Convert the input string into the appropriate debug log level setting .
164,223
private static Throwable findRootCause ( Throwable t ) { Throwable root = t ; Throwable cause = root . getCause ( ) ; while ( cause != null ) { root = cause ; cause = root . getCause ( ) ; } return root ; }
Find root cause of a specified Throwable object .
164,224
public void setCheckConfig ( boolean checkConfig ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setCheckConfig: " + checkConfig ) ; ivCheckConfig = checkConfig ; }
F743 - 33178
164,225
public void addSingleton ( BeanMetaData bmd , boolean startup , Set < String > dependsOnLinks ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "addSingleton: " + bmd . j2eeName + " (startup=" + startup + ", dependsOn=" + ( dependsOnLinks != null ) + ")" ) ; if ( startup ) { if ( ivStartupSingletonList == null ) { ivStartupSingletonList = new ArrayList < J2EEName > ( ) ; } ivStartupSingletonList . add ( bmd . j2eeName ) ; } if ( dependsOnLinks != null ) { if ( ivSingletonDependencies == null ) { ivSingletonDependencies = new LinkedHashMap < BeanMetaData , Set < String > > ( ) ; } ivSingletonDependencies . put ( bmd , dependsOnLinks ) ; } }
Adds a singleton bean belonging to this application .
164,226
public synchronized void checkIfCreateNonPersistentTimerAllowed ( EJBModuleMetaDataImpl mmd ) { if ( ivStopping ) { throw new EJBStoppedException ( ivName ) ; } if ( mmd != null && mmd . ivStopping ) { throw new EJBStoppedException ( mmd . getJ2EEName ( ) . toString ( ) ) ; } }
Prevent non - persistent timers from being created after the application or module has begun stopping .
164,227
private void finishStarting ( ) throws RuntimeWarning { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "finishStarting: " + ivName ) ; if ( ivModules != null ) { notifyApplicationEventListeners ( ivModules , true ) ; } unblockThreadsWaitingForStart ( ) ; synchronized ( this ) { if ( ivQueuedNonPersistentTimers != null ) { startQueuedNonPersistentTimerAlarms ( ) ; ivQueuedNonPersistentTimers = null ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "finishStarting" ) ; }
Notification that the application is about to finish starting . Performs processing of singletons after all modules have been started but before the application has finished starting . Module references are resolved and startup singletons are started .
164,228
private HomeRecord resolveEJBLink ( J2EEName source , String link ) throws RuntimeWarning { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "resolveEJBLink: " + link ) ; String module = source . getModule ( ) ; String component = source . getComponent ( ) ; HomeRecord result ; try { result = EJSContainer . homeOfHomes . resolveEJBLink ( source . getApplication ( ) , module , link ) ; } catch ( EJBNotFoundException ex ) { Tr . error ( tc , "SINGLETON_DEPENDS_ON_NONEXISTENT_BEAN_CNTR0198E" , new Object [ ] { component , module , link } ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resolveEJBLink" ) ; throw new RuntimeWarning ( "CNTR0198E: The " + component + " singleton session bean in the " + module + " module depends on " + link + ", which does not exist." , ex ) ; } catch ( AmbiguousEJBReferenceException ex ) { Tr . error ( tc , "SINGLETON_DEPENDS_ON_AMBIGUOUS_NAME_CNTR0199E" , new Object [ ] { component , module , link } ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resolveEJBLink" ) ; throw new RuntimeWarning ( "CNTR0199E: The " + component + " singleton session bean in the " + module + " module depends on " + link + ", which does not uniquely specify an enterprise bean." , ex ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resolveEJBLink: " + result ) ; return result ; }
Resolves a dependency reference link to another EJB .
164,229
private void resolveDependencies ( ) throws RuntimeWarning { if ( EJSPlatformHelper . isZOSCRA ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "resolveDependencies: skipped in adjunct process" ) ; return ; } if ( ivSingletonDependencyResolutionException != null ) { throw ivSingletonDependencyResolutionException ; } Set < BeanMetaData > used = new HashSet < BeanMetaData > ( ) ; for ( BeanMetaData bmd : new ArrayList < BeanMetaData > ( ivSingletonDependencies . keySet ( ) ) ) { used . add ( bmd ) ; resolveBeanDependencies ( bmd , used ) ; used . remove ( bmd ) ; } }
Resolves and verifies the singleton dependency links .
164,230
private void resolveBeanDependencies ( BeanMetaData bmd , Set < BeanMetaData > used ) throws RuntimeWarning { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "resolveBeanDependencies: " + bmd . j2eeName ) ; if ( bmd . ivDependsOn != null ) { return ; } bmd . ivDependsOn = new ArrayList < J2EEName > ( ) ; Set < String > dependsOnLinks = ivSingletonDependencies . remove ( bmd ) ; if ( dependsOnLinks == null ) { return ; } for ( String dependencyLink : dependsOnLinks ) { HomeRecord hr = resolveEJBLink ( bmd . j2eeName , dependencyLink ) ; BeanMetaData dependency = hr . getBeanMetaData ( ) ; J2EEName dependencyName = dependency . j2eeName ; if ( ! dependency . isSingletonSessionBean ( ) ) { Tr . error ( tc , "SINGLETON_DEPENDS_ON_NON_SINGLETON_BEAN_CNTR0200E" , new Object [ ] { bmd . j2eeName . getComponent ( ) , bmd . j2eeName . getModule ( ) , dependencyName . getComponent ( ) , dependencyName . getModule ( ) } ) ; throw new RuntimeWarning ( "CNTR0200E: The " + bmd . j2eeName . getComponent ( ) + " singleton session bean in the " + bmd . j2eeName . getModule ( ) + " module depends on the " + dependencyName . getComponent ( ) + " enterprise bean in the " + dependencyName . getModule ( ) + ", but the target is not a singleton session bean." ) ; } if ( ! used . add ( dependency ) ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "circular dependency from " + dependencyName ) ; Tr . error ( tc , "SINGLETON_DEPENDS_ON_SELF_CNTR0201E" , new Object [ ] { dependencyName . getComponent ( ) , dependencyName . getModule ( ) } ) ; throw new RuntimeWarning ( "CNTR0201E: The " + dependencyName . getComponent ( ) + " singleton session bean in the " + dependencyName . getModule ( ) + " module directly or indirectly depends on itself." ) ; } bmd . ivDependsOn . add ( dependencyName ) ; resolveBeanDependencies ( dependency , used ) ; used . remove ( dependency ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resolveBeanDependencies: " + bmd . j2eeName ) ; }
Verifies that the specified bean only depends on other singletons and that it does not depend on itself . This method calls itself recursively to process all dependencies .
164,231
private void createStartupBeans ( ) throws RuntimeWarning { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( EJSPlatformHelper . isZOSCRA ( ) ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "createStartupBeans: skipped in adjunct process" ) ; return ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createStartupBeans" ) ; for ( int i = 0 , size = ivStartupSingletonList . size ( ) ; i < size ; i ++ ) { J2EEName startupName = ivStartupSingletonList . get ( i ) ; try { EJSHome home = ( EJSHome ) EJSContainer . homeOfHomes . getHome ( startupName ) ; if ( home == null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Ignoring Singleton Startup bean: " + startupName ) ; } else { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Creating instance for Singleton Startup bean: " + startupName . toString ( ) ) ; home . createSingletonBeanO ( ) ; } } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".createStartupBeans" , "6921" , this ) ; Tr . error ( tc , "STARTUP_SINGLETON_SESSION_BEAN_INITIALIZATION_FAILED_CNTR0190E" , new Object [ ] { startupName . getComponent ( ) , startupName . getModule ( ) , t } ) ; throw new RuntimeWarning ( "CNTR0201E: The " + startupName . getComponent ( ) + " startup singleton session bean in the " + startupName . getModule ( ) + " module failed initialization." , t ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createStartupBeans" ) ; }
Creates all startup singleton beans .
164,232
private void notifyApplicationEventListeners ( Collection < EJBModuleMetaDataImpl > modules , boolean started ) throws RuntimeWarning { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "notifyApplicationEventListeners: started=" + started ) ; RuntimeWarning warning = null ; for ( EJBModuleMetaDataImpl mmd : modules ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "notifying listeners in module: " + mmd . ivJ2EEName ) ; List < EJBApplicationEventListener > listeners = mmd . ivApplicationEventListeners ; if ( listeners != null ) { for ( EJBApplicationEventListener listener : listeners ) { try { if ( started ) { listener . applicationStarted ( ivName ) ; } else { listener . applicationStopping ( ivName ) ; } } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".notifyApplicationEventListeners" , "781" , this ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , listener + " threw unexpected throwable: " + t , t ) ; if ( warning == null ) { warning = new RuntimeWarning ( t ) ; } } } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "notifyApplicationEventListeners: exception=" + warning ) ; if ( warning != null ) { throw warning ; } }
Notifies all application event listeners in the specified modules .
164,233
public synchronized void addSingletonInitialization ( EJSHome home ) { if ( ivStopping ) { throw new EJBStoppedException ( home . getJ2EEName ( ) . toString ( ) ) ; } if ( ivSingletonInitializations == null ) { ivSingletonInitializations = new LinkedHashSet < EJSHome > ( ) ; } ivSingletonInitializations . add ( home ) ; }
Record the initialization attempt of a singleton . This method must not be called for a bean before it is called for each of that bean s dependencies . This method may be called multiple times for the same bean but only the first call will have an effect .
164,234
public synchronized boolean queueOrStartNonPersistentTimerAlarm ( TimerNpImpl timer , EJBModuleMetaDataImpl module ) { if ( ivStopping ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "not starting timer alarm after application stop: " + timer ) ; return false ; } else { if ( isStarted ( ) ) { timer . schedule ( ) ; } else if ( ivModuleBeingAddedLate != null && ivModuleBeingAddedLate != module ) { timer . schedule ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "queueing timer alarm until full application start: " + timer ) ; if ( ivQueuedNonPersistentTimers == null ) { ivQueuedNonPersistentTimers = new ArrayList < TimerNpImpl > ( ) ; } ivQueuedNonPersistentTimers . add ( timer ) ; } } return true ; }
Queues or starts a non - persistent timer alarm returning an indication of whether or not the operation was successful .
164,235
private void beginStopping ( boolean application , J2EEName j2eeName , Collection < EJBModuleMetaDataImpl > modules ) { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "beginStopping: application=" + application + ", " + j2eeName ) ; synchronized ( this ) { if ( application ) { ivStopping = true ; } unblockThreadsWaitingForStart ( ) ; } if ( j2eeName != null ) { ivContainer . getEJBRuntime ( ) . removeTimers ( j2eeName ) ; } if ( ivSingletonInitializations != null ) { List < EJSHome > reverse = new ArrayList < EJSHome > ( ivSingletonInitializations ) ; for ( int i = reverse . size ( ) ; -- i >= 0 ; ) { EJSHome home = reverse . get ( i ) ; J2EEName homeJ2EEName = home . getJ2EEName ( ) ; if ( application || ( j2eeName . getModule ( ) . equals ( homeJ2EEName . getModule ( ) ) ) ) { home . destroy ( ) ; ivSingletonInitializations . remove ( home ) ; } } } try { notifyApplicationEventListeners ( modules , false ) ; } catch ( RuntimeWarning rw ) { FFDCFilter . processException ( rw , CLASS_NAME + ".stopping" , "977" , this ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "beginStopping" ) ; }
Notification that the application or a module within the application will begin stopping stopping . This method should never throw an exception .
164,236
public void stoppingModule ( EJBModuleMetaDataImpl mmd ) { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "stoppingModule: " + mmd . getJ2EEName ( ) ) ; if ( ! ivStopping ) { mmd . ivStopping = true ; ivModules . remove ( mmd ) ; try { beginStopping ( false , mmd . getJ2EEName ( ) , Collections . singletonList ( mmd ) ) ; } finally { ivSingletonDependencies = null ; ivStartupSingletonList = null ; ivQueuedNonPersistentTimers = null ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "stoppingModule" ) ; }
Notification that a module within this application will begin stopping . This method should never throw an exception .
164,237
public void stopping ( ) { boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "stopping" ) ; J2EEName j2eeName = ivApplicationMetaData == null ? null : ivApplicationMetaData . getJ2EEName ( ) ; beginStopping ( true , j2eeName , ivModules ) ; }
Notification that the application will begin stopping .
164,238
void validateVersionedModuleBaseName ( String appBaseName , String modBaseName ) { for ( EJBModuleMetaDataImpl ejbMMD : ivModules ) { String versionedAppBaseName = ejbMMD . ivVersionedAppBaseName ; if ( versionedAppBaseName != null && ! versionedAppBaseName . equals ( appBaseName ) ) { throw new IllegalArgumentException ( "appBaseName (" + appBaseName + ") does not equal previously set value : " + versionedAppBaseName ) ; } if ( modBaseName . equals ( ejbMMD . ivVersionedModuleBaseName ) ) { throw new IllegalArgumentException ( "duplicate baseName : " + modBaseName ) ; } } }
F54184 . 1 F54184 . 2
164,239
public SIBusMessage next ( ) throws SISessionDroppedException , SIConnectionDroppedException , SISessionUnavailableException , SIConnectionUnavailableException , SIConnectionLostException , SINotAuthorizedException , SIResourceException , SIErrorException { checkValid ( ) ; return _delegate . next ( ) ; }
Browses the next message . Checks that the session is valid and then delegates .
164,240
public void reset ( ) throws SISessionDroppedException , SIConnectionDroppedException , SISessionUnavailableException , SIConnectionUnavailableException , SIConnectionLostException , SIResourceException , SIErrorException { checkValid ( ) ; _delegate . reset ( ) ; }
Resets the browse cursor . Checks that the session is valid and then delegates .
164,241
private void writeObject ( ObjectOutputStream out ) throws IOException { try { out . defaultWriteObject ( ) ; out . write ( EYECATCHER ) ; out . writeShort ( PLATFORM ) ; out . writeShort ( VERSION_ID ) ; if ( DEBUG_ON ) { System . out . println ( "EJBMetaDataImpl.writeObject: ivSession = " + ivSession ) ; } out . writeBoolean ( ivSession ) ; if ( DEBUG_ON ) { System . out . println ( "EJBMetaDataImpl.writeObject: ivStatelessSession = " + ivStatelessSession ) ; } out . writeBoolean ( ivStatelessSession ) ; if ( DEBUG_ON ) { System . out . println ( "EJBMetaDataImpl.writeObject: ivBeanClass is " + ivBeanClassName ) ; } out . writeUTF ( ivBeanClassName ) ; if ( DEBUG_ON ) { System . out . println ( "EJBMetaDataImpl.writeObject: ivHomeClass is " + ivHomeClass . getName ( ) ) ; } out . writeUTF ( ivHomeClass . getName ( ) ) ; if ( DEBUG_ON ) { System . out . println ( "EJBMetaDataImpl.writeObject: ivRemoteClass is " + ivRemoteClass . getName ( ) ) ; } out . writeUTF ( ivRemoteClass . getName ( ) ) ; if ( ivSession == false ) { if ( DEBUG_ON ) { System . out . println ( "EJBMetaDataImpl.writeObject: ivPKClass is " + ivPKClass . getName ( ) ) ; } out . writeUTF ( ivPKClass . getName ( ) ) ; } if ( DEBUG_ON ) { System . out . println ( "EJBMetaDataImpl.writeObject: writing HomeHandle" ) ; } out . writeObject ( ivHomeHandle ) ; if ( DEBUG_ON ) { System . out . println ( "EJBMetaDataImpl.writeObject normal exit" ) ; } } catch ( IOException e ) { if ( DEBUG_ON ) { System . out . println ( "***ERROR**** EJBMetaDataImpl.readObject caught unexpected exception" ) ; e . printStackTrace ( ) ; } throw e ; } }
We will implement writeObject in order to controll the marshalling for this object . Note this is overriding the default implementation of the Serializable interface .
164,242
public static TransmissionLayout segmentToLayout ( int segment ) { TransmissionLayout layout = XMIT_LAYOUT_UNKNOWN ; switch ( segment ) { case 0x00 : layout = XMIT_LAYOUT_UNKNOWN ; break ; case JFapChannelConstants . SEGMENT_HEARTBEAT : case JFapChannelConstants . SEGMENT_HEARTBEAT_RESPONSE : case JFapChannelConstants . SEGMENT_PHYSICAL_CLOSE : layout = XMIT_PRIMARY_ONLY ; break ; case JFapChannelConstants . SEGMENT_SEGMENTED_FLOW_START : layout = XMIT_SEGMENT_START ; break ; case JFapChannelConstants . SEGMENT_SEGMENTED_FLOW_MIDDLE : layout = XMIT_SEGMENT_MIDDLE ; break ; case JFapChannelConstants . SEGMENT_SEGMENTED_FLOW_END : layout = XMIT_SEGMENT_END ; break ; default : layout = XMIT_CONVERSATION ; break ; } return layout ; }
Converts from a segment ID to a layout for the transmission .
164,243
public static String getSegmentName ( int segmentType ) { String segmentName = "(Unknown segment type)" ; segmentName = segValues . get ( segmentType ) ; if ( segmentName == null ) segmentName = "(Unknown segment type)" ; return segmentName ; }
This method can be used to return the actual segment name for a given segment type .
164,244
private boolean updateConfiguration ( EvaluationResult result , ConfigurationInfo info , Collection < ConfigurationInfo > infos , boolean encourageUpdates ) throws ConfigUpdateException { encourageUpdates &= ! ! ! ( result . getRegistryEntry ( ) != null && result . getRegistryEntry ( ) . supportsHiddenExtensions ( ) ) ; boolean nestedUpdates = false ; boolean propertiesUpdated = false ; Map < ConfigID , EvaluationResult > nested = result . getNested ( ) ; for ( Map . Entry < ConfigID , EvaluationResult > entry : nested . entrySet ( ) ) { EvaluationResult nestedResult = entry . getValue ( ) ; ExtendedConfiguration nestedConfig = caSupport . findConfiguration ( nestedResult . getPid ( ) ) ; if ( nestedConfig == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Configuration not found: " + nestedResult . getPid ( ) ) ; } } else { ConfigurationInfo nestedInfo = new ConfigurationInfo ( nestedResult . getConfigElement ( ) , nestedConfig , nestedResult . getRegistryEntry ( ) , false ) ; boolean updated = updateConfiguration ( nestedResult , nestedInfo , infos , encourageUpdates ) ; if ( updated && ( result . getRegistryEntry ( ) != null && result . getRegistryEntry ( ) . supportsHiddenExtensions ( ) ) ) { updated = false ; } nestedUpdates |= updated ; } } ExtendedConfiguration config = info . config ; config . setInOverridesFile ( true ) ; Set < ConfigID > oldReferences = config . getReferences ( ) ; Set < ConfigID > newReferences = result . getReferences ( ) ; Dictionary < String , Object > oldProperties = config . getReadOnlyProperties ( ) ; Dictionary < String , Object > newProperties = result . getProperties ( ) ; if ( encourageUpdates || nestedUpdates || ! equalConfigProperties ( oldProperties , newProperties , encourageUpdates ) || ! equalConfigReferences ( oldReferences , newReferences ) ) { propertiesUpdated = true ; crossReference ( oldProperties , newProperties ) ; variableRegistry . updateVariableCache ( result . getVariables ( ) ) ; Dictionary < String , Object > newProp = massageNewConfig ( oldProperties , newProperties ) ; Set < String > newUniques = updateUniqueVariables ( info , oldProperties , newProp ) ; try { config . updateCache ( newProp , newReferences , newUniques ) ; } catch ( IOException ex ) { throw new ConfigUpdateException ( ex ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Updated configuration: " + toTraceString ( config , result . getConfigElement ( ) ) ) ; } if ( infos != null ) { infos . add ( info ) ; } } extendedMetatypeManager . createSuperTypes ( info ) ; return ( propertiesUpdated || nestedUpdates ) ; }
Recursively updates the configuration in config admin
164,245
private static Dictionary < String , Object > massageNewConfig ( Dictionary < String , Object > oldProps , Dictionary < String , Object > newProps ) { ConfigurationDictionary ret = new ConfigurationDictionary ( ) ; if ( oldProps != null ) { for ( Enumeration < String > keyItr = oldProps . keys ( ) ; keyItr . hasMoreElements ( ) ; ) { String key = keyItr . nextElement ( ) ; if ( ( ( key . startsWith ( XMLConfigConstants . CFG_CONFIG_PREFIX ) && ! ( key . equals ( XMLConfigConstants . CFG_PARENT_PID ) ) ) || key . startsWith ( XMLConfigConstants . CFG_SERVICE_PREFIX ) ) ) { ret . put ( key , oldProps . get ( key ) ) ; } } } if ( newProps != null ) { for ( Enumeration < String > keyItr = newProps . keys ( ) ; keyItr . hasMoreElements ( ) ; ) { String key = keyItr . nextElement ( ) ; ret . put ( key , newProps . get ( key ) ) ; } } if ( ret . isEmpty ( ) ) { ret = null ; } else { ret . put ( XMLConfigConstants . CFG_CONFIG_SOURCE , XMLConfigConstants . CFG_CONFIG_SOURCE_FILE ) ; } return ret ; }
Return a new config dictionary with initial hidden keys and values from o then add all keys and values from n to the new config dictionary and return . If returning dictionary is empty return null instead .
164,246
void reset ( com . ibm . wsspi . bytebuffer . WsByteBuffer buff , RichByteBufferPool p ) { this . buffer = buff ; this . pool = p ; }
Resets the buffer with a new underlying buffer .
164,247
public synchronized void setDelegate ( Future < V > delegate ) { if ( delegateHolder . isCancelled ( ) ) { delegate . cancel ( mayInterruptWhenCancellingDelegate ) ; } else { this . delegate = delegate ; delegateHolder . complete ( delegate ) ; } }
Set the Future to delegate calls to
164,248
public boolean isUnauthenticated ( Subject subject ) { if ( subject == null ) { return true ; } WSCredential wsCred = getWSCredential ( subject ) ; if ( wsCred == null ) { return true ; } else { return wsCred . isUnauthenticated ( ) ; } }
Check whether the subject is un - authenticated or not .
164,249
public String getRealm ( Subject subject ) throws Exception { String realm = null ; WSCredential credential = getWSCredential ( subject ) ; if ( credential != null ) { realm = credential . getRealmName ( ) ; } return realm ; }
Gets the realm from the subjects WSCredential .
164,250
public static GSSCredential getGSSCredentialFromSubject ( final Subject subject ) { if ( subject == null ) { return null ; } GSSCredential gssCredential = AccessController . doPrivileged ( new PrivilegedAction < GSSCredential > ( ) { public GSSCredential run ( ) { GSSCredential gssCredInSubject = null ; Set < GSSCredential > privCredentials = subject . getPrivateCredentials ( GSSCredential . class ) ; if ( privCredentials != null ) { Iterator < GSSCredential > privCredItr = privCredentials . iterator ( ) ; if ( privCredItr . hasNext ( ) ) { gssCredInSubject = privCredItr . next ( ) ; } } return gssCredInSubject ; } } ) ; if ( gssCredential == null ) { KerberosTicket tgt = getKerberosTicketFromSubject ( subject , null ) ; if ( tgt != null ) { gssCredential = createGSSCredential ( subject , tgt ) ; } } return gssCredential ; }
Gets a GSSCredential from a Subject
164,251
public Hashtable < String , Object > createNewHashtableInSubject ( final Subject subject ) { return AccessController . doPrivileged ( new NewHashtablePrivilegedAction ( subject ) ) ; }
Creates a Hashtable of values in the Subject without tracing the Subject .
164,252
public Hashtable < String , ? > getSensitiveHashtableFromSubject ( final Subject subject ) { if ( System . getSecurityManager ( ) == null ) { return getHashtableFromSubject ( subject ) ; } else { return AccessController . doPrivileged ( new GetHashtablePrivilegedAction ( subject ) ) ; } }
Gets a Hashtable of values from the Subject without tracing the Subject or hashtable .
164,253
public Hashtable < String , ? > getSensitiveHashtableFromSubject ( final Subject subject , final String [ ] properties ) { return AccessController . doPrivileged ( new PrivilegedAction < Hashtable < String , ? > > ( ) { public Hashtable < String , ? > run ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Looking for custom properties in public cred list." ) ; } Set < Object > list_public = subject . getPublicCredentials ( ) ; Hashtable < String , ? > hashtableFromPublic = getSensitiveHashtable ( list_public , properties ) ; if ( hashtableFromPublic != null ) { return hashtableFromPublic ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Looking for custom properties in private cred list." ) ; } Set < Object > list_private = subject . getPrivateCredentials ( ) ; Hashtable < String , ? > hashtableFromPrivate = getSensitiveHashtable ( list_private , properties ) ; if ( hashtableFromPrivate != null ) { return hashtableFromPrivate ; } return null ; } } ) ; }
Gets a Hashtable of values from the Subject but do not trace the hashtable
164,254
public static void traceMessageIds ( TraceComponent callersTrace , String action , SIMessageHandle [ ] messageHandles ) { if ( ( light_tc . isDebugEnabled ( ) || callersTrace . isDebugEnabled ( ) ) && messageHandles != null ) { StringBuffer trcBuffer = new StringBuffer ( ) ; trcBuffer . append ( action + ": [" ) ; for ( int i = 0 ; i < messageHandles . length ; i ++ ) { if ( i != 0 ) trcBuffer . append ( "," ) ; if ( messageHandles [ i ] != null ) { trcBuffer . append ( messageHandles [ i ] . getSystemMessageId ( ) ) ; } } trcBuffer . append ( "]" ) ; if ( light_tc . isDebugEnabled ( ) ) { SibTr . debug ( light_tc , trcBuffer . toString ( ) ) ; } else { SibTr . debug ( callersTrace , trcBuffer . toString ( ) ) ; } } }
Allow tracing of messages and transaction when deleting
164,255
public static void traceTransaction ( TraceComponent callersTrace , String action , Object transaction , int commsId , int commsFlags ) { if ( light_tc . isDebugEnabled ( ) || callersTrace . isDebugEnabled ( ) ) { String traceText = action + ": " + transaction + " CommsId:" + commsId + " CommsFlags:" + commsFlags ; if ( light_tc . isDebugEnabled ( ) ) { SibTr . debug ( light_tc , traceText ) ; } else { SibTr . debug ( callersTrace , traceText ) ; } } }
Trace a transaction associated with an action .
164,256
public static void traceException ( TraceComponent callersTrace , Throwable ex ) { if ( light_tc . isDebugEnabled ( ) || callersTrace . isDebugEnabled ( ) ) { String xaErrStr = null ; if ( ex instanceof XAException ) { XAException xaex = ( XAException ) ex ; xaErrStr = "XAExceptionErrorCode: " + xaex . errorCode ; } if ( light_tc . isDebugEnabled ( ) ) { if ( xaErrStr != null ) SibTr . debug ( light_tc , xaErrStr ) ; SibTr . exception ( light_tc , ex ) ; } else { if ( xaErrStr != null ) SibTr . debug ( callersTrace , xaErrStr ) ; SibTr . exception ( callersTrace , ex ) ; } } }
Trace an exception .
164,257
public static String minimalToString ( Object object ) { return object . getClass ( ) . getName ( ) + "@" + Integer . toHexString ( System . identityHashCode ( object ) ) ; }
Util to prevent full dump of the conversation in this class as that will print too much data if trace of this class is turned on to get transaction and msgid information
164,258
public static String msgToString ( SIBusMessage message ) { if ( message == null ) return STRING_NULL ; return message + "[" + message . getSystemMessageId ( ) + "]" ; }
Util to trace the System Message ID of a message along with the default toString
164,259
private final static void retransformClass ( Class < ? > clazz ) { if ( detailedTransformTrace && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "retransformClass" , clazz ) ; try { instrumentation . retransformClasses ( clazz ) ; } catch ( Throwable t ) { Tr . error ( tc , "INSTRUMENTATION_TRANSFORM_FAILED_FOR_CLASS_2" , clazz . getName ( ) , t ) ; } if ( detailedTransformTrace && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "retransformClass" ) ; }
Ask the JVM to retransform the class that has recently been enabled for trace . This class will explicitly call the class loader to load and initialize the class to work around an IBM JDK issue with hot code replace during class initialization .
164,260
public void send ( final SIBusMessage msg , final SITransaction tran ) throws SISessionDroppedException , SIConnectionDroppedException , SISessionUnavailableException , SIConnectionUnavailableException , SIConnectionLostException , SILimitExceededException , SINotAuthorizedException , SIResourceException , SIErrorException , SIIncorrectCallException , SINotPossibleInCurrentConfigurationException { checkValid ( ) ; _delegate . send ( msg , _parentConnection . mapTransaction ( tran ) ) ; }
Sends a message . Checks that the session is valid . Maps the transaction parameter before delegating .
164,261
protected IOResult attemptReadFromSocket ( TCPBaseRequestContext readReq , boolean fromSelector ) throws IOException { IOResult rc = IOResult . NOT_COMPLETE ; TCPReadRequestContextImpl req = ( TCPReadRequestContextImpl ) readReq ; TCPConnLink conn = req . getTCPConnLink ( ) ; long dataRead = 0 ; if ( req . getJITAllocateSize ( ) > 0 && req . getBuffers ( ) == null ) { if ( conn . getConfig ( ) . getAllocateBuffersDirect ( ) ) { req . setBuffer ( ChannelFrameworkFactory . getBufferManager ( ) . allocateDirect ( req . getJITAllocateSize ( ) ) ) ; } else { req . setBuffer ( ChannelFrameworkFactory . getBufferManager ( ) . allocate ( req . getJITAllocateSize ( ) ) ) ; } req . setJITAllocateAction ( true ) ; } WsByteBuffer wsBuffArray [ ] = req . getBuffers ( ) ; dataRead = attemptReadFromSocketUsingNIO ( req , wsBuffArray ) ; req . setLastIOAmt ( dataRead ) ; req . setIODoneAmount ( req . getIODoneAmount ( ) + dataRead ) ; if ( req . getIODoneAmount ( ) >= req . getIOAmount ( ) ) { rc = IOResult . COMPLETE ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Read " + dataRead + "(" + + req . getIODoneAmount ( ) + ")" + " bytes, " + req . getIOAmount ( ) + " requested on local: " + getSocket ( ) . getLocalSocketAddress ( ) + " remote: " + getSocket ( ) . getRemoteSocketAddress ( ) ) ; } if ( req . getLastIOAmt ( ) < 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) && ! conn . getConfig ( ) . isInbound ( ) ) { Tr . event ( this , tc , "Empty read on outbound." ) ; } if ( req . getJITAllocateAction ( ) ) { req . getBuffer ( ) . release ( ) ; req . setBuffer ( null ) ; req . setJITAllocateAction ( false ) ; } return IOResult . FAILED ; } if ( rc == IOResult . COMPLETE ) { req . setIOCompleteAmount ( req . getIODoneAmount ( ) ) ; req . setIODoneAmount ( 0 ) ; } else if ( rc == IOResult . NOT_COMPLETE && ! fromSelector && req . getJITAllocateAction ( ) && req . getLastIOAmt ( ) == 0 ) { req . getBuffer ( ) . release ( ) ; req . setBuffers ( null ) ; req . setJITAllocateAction ( true ) ; } return rc ; }
Attempt to read for the socket .
164,262
protected IOResult attemptWriteToSocket ( TCPBaseRequestContext req ) throws IOException { IOResult rc = IOResult . NOT_COMPLETE ; WsByteBuffer wsBuffArray [ ] = req . getBuffers ( ) ; long bytesWritten = attemptWriteToSocketUsingNIO ( req , wsBuffArray ) ; req . setLastIOAmt ( bytesWritten ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Wrote " + bytesWritten + " bytes, " + req . getIOAmount ( ) + " requested on local: " + getSocket ( ) . getLocalSocketAddress ( ) + " remote: " + getSocket ( ) . getRemoteSocketAddress ( ) ) ; } if ( bytesWritten < 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) && ! req . getTCPConnLink ( ) . getConfig ( ) . isInbound ( ) ) { Tr . event ( this , tc , "invalid value returned for bytes written" ) ; } return IOResult . FAILED ; } if ( req . getIOAmount ( ) == TCPWriteRequestContext . WRITE_ALL_DATA ) { ByteBuffer [ ] buffers = req . getByteBufferArray ( ) ; rc = IOResult . COMPLETE ; for ( int i = 0 ; i < buffers . length ; i ++ ) { if ( buffers [ i ] . hasRemaining ( ) ) { rc = IOResult . NOT_COMPLETE ; break ; } } req . setIODoneAmount ( req . getIODoneAmount ( ) + bytesWritten ) ; } else { req . setIODoneAmount ( req . getIODoneAmount ( ) + bytesWritten ) ; if ( req . getIODoneAmount ( ) >= req . getIOAmount ( ) ) { rc = IOResult . COMPLETE ; } } if ( rc == IOResult . COMPLETE ) { req . setIOCompleteAmount ( req . getIODoneAmount ( ) ) ; req . setIODoneAmount ( 0 ) ; } return rc ; }
Attempt to write information stored in the active buffers to the network .
164,263
static String getServerResourceAbsolutePath ( String resourcePath ) { String path = null ; File f = new File ( resourcePath ) ; if ( f . isAbsolute ( ) ) { path = resourcePath ; } else { WsLocationAdmin wla = locationService . getServiceWithException ( ) ; if ( wla != null ) path = wla . resolveString ( SERVER_CONFIG_LOCATION + "/" + resourcePath ) ; } return path ; }
Return the absolute path of the given resource path relative to the server config dir . If the given resource path is already absolute then just return it . If the location admin service is not available then return null .
164,264
private AuthConfigProvider getAuthConfigProvider ( String appContext ) { AuthConfigProvider provider = null ; AuthConfigFactory providerFactory = getAuthConfigFactory ( ) ; if ( providerFactory != null ) { if ( providerConfigModified && providerFactory instanceof ProviderRegistry ) { ( ( ProviderRegistry ) providerFactory ) . setProvider ( jaspiProviderServiceRef . getService ( ) ) ; providerConfigModified = false ; } provider = providerFactory . getConfigProvider ( "HttpServlet" , appContext , ( RegistrationListener ) null ) ; } return provider ; }
Some comment why we re doing this
164,265
protected Subject doHashTableLogin ( Subject clientSubject , JaspiRequest jaspiRequest ) throws WSLoginFailedException { Subject authenticatedSubject = null ; final Hashtable < String , Object > hashTable = getCustomCredentials ( clientSubject ) ; String unauthenticatedSubjectString = UNAUTHENTICATED_ID ; String user = null ; if ( hashTable == null ) { Subject sessionSubject = getSessionSubject ( jaspiRequest ) ; if ( sessionSubject != null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "No HashTable returned by the JASPI provider. Using JASPI session subject." ) ; return sessionSubject ; } MessageInfo msgInfo = jaspiRequest . getMessageInfo ( ) ; boolean isProtected = Boolean . parseBoolean ( ( String ) msgInfo . getMap ( ) . get ( IS_MANDATORY_POLICY ) ) ; if ( isProtected ) { String msg = "JASPI HashTable login cannot be performed, JASPI provider did not return a HashTable." ; throw new WSLoginFailedException ( msg ) ; } else { user = unauthenticatedSubjectString ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Web resource is unprotected and Subject does not have a HashTable." ) ; } } else { user = ( String ) hashTable . get ( AttributeNameConstants . WSCREDENTIAL_SECURITYNAME ) ; } boolean isUnauthenticated = unauthenticatedSubjectString . equals ( user ) ; if ( isUnauthenticated ) { authenticatedSubject = getUnauthenticatedSubject ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "JASPI Subject is unauthenticated, HashTable login is not necessary." ) ; } else { if ( user == null ) user = "" ; Subject loginSubject = clientSubject ; final Subject sessionSubject = getSessionSubject ( jaspiRequest ) ; if ( sessionSubject != null ) { final Subject clone = new Subject ( ) ; clone . getPrivateCredentials ( ) . addAll ( sessionSubject . getPrivateCredentials ( ) ) ; clone . getPublicCredentials ( ) . addAll ( sessionSubject . getPublicCredentials ( ) ) ; clone . getPrincipals ( ) . addAll ( sessionSubject . getPrincipals ( ) ) ; clone . getPrivateCredentials ( ) . add ( hashTable ) ; loginSubject = clone ; } final HttpServletRequest req = jaspiRequest . getHttpServletRequest ( ) ; final HttpServletResponse res = ( HttpServletResponse ) jaspiRequest . getMessageInfo ( ) . getResponseMessage ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "JASPI login with HashTable: " + hashTable ) ; } AuthenticationResult result = getWebProviderAuthenticatorHelper ( ) . loginWithHashtable ( req , res , loginSubject ) ; authenticatedSubject = result . getSubject ( ) ; if ( sessionSubject != null ) { removeCustomCredentials ( sessionSubject , hashTable ) ; } if ( authenticatedSubject == null ) { throw new WSLoginFailedException ( "JASPI HashTable login failed, user: " + user ) ; } } return authenticatedSubject ; }
Create a WAS Subject using the HashTable obtained from the JASPI provider
164,266
public List < com . ibm . wsspi . security . wim . model . Context > getContexts ( ) { if ( contexts == null ) { contexts = new ArrayList < com . ibm . wsspi . security . wim . model . Context > ( ) ; } return this . contexts ; }
Gets the value of the contexts property .
164,267
public List < com . ibm . wsspi . security . wim . model . Entity > getEntities ( ) { if ( entities == null ) { entities = new ArrayList < com . ibm . wsspi . security . wim . model . Entity > ( ) ; } return this . entities ; }
Gets the value of the entities property .
164,268
public List < com . ibm . wsspi . security . wim . model . Control > getControls ( ) { if ( controls == null ) { controls = new ArrayList < com . ibm . wsspi . security . wim . model . Control > ( ) ; } return this . controls ; }
Gets the value of the controls property .
164,269
private int skipForward ( char [ ] chars , int start , int length ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "skipForward" , new Object [ ] { chars , new Integer ( start ) , new Integer ( length ) } ) ; int ans = length ; for ( int i = 0 ; i < length ; i ++ ) if ( chars [ start + i ] == MatchSpace . SUBTOPIC_SEPARATOR_CHAR ) { ans = i ; break ; } if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "skipForward" , new Integer ( ans ) ) ; return ans ; }
Skip forward to next separator
164,270
void get ( char [ ] chars , int start , int length , boolean invert , MatchSpaceKey msg , EvalCache cache , Object contextValue , SearchResults result ) throws MatchingException , BadMessageFormatMatchingException { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "get" , new Object [ ] { chars , new Integer ( start ) , new Integer ( length ) , new Boolean ( invert ) , msg , cache , result } ) ; if ( start == chars . length || chars [ start ] != MatchSpace . NONWILD_MARKER ) super . get ( chars , start , length , invert , msg , cache , contextValue , result ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "get" ) ; }
Override get to rule out NONWILD_MARKER
164,271
public static void reloadApplications ( LibertyServer server , final Set < String > appIdsToReload ) throws Exception { ServerConfiguration config = server . getServerConfiguration ( ) . clone ( ) ; ConfigElementList < Application > toRemove = new ConfigElementList < Application > ( config . getApplications ( ) . stream ( ) . filter ( app -> appIdsToReload . contains ( app . getId ( ) ) ) . collect ( Collectors . toList ( ) ) ) ; config . getApplications ( ) . removeAll ( toRemove ) ; updateConfigDynamically ( server , config , true ) ; config . getApplications ( ) . addAll ( toRemove ) ; updateConfigDynamically ( server , config , true ) ; }
Reload select applications .
164,272
public static void updateConfigDynamically ( LibertyServer server , ServerConfiguration config , boolean waitForAppToStart ) throws Exception { resetMarksInLogs ( server ) ; server . updateServerConfiguration ( config ) ; server . waitForStringInLogUsingMark ( "CWWKG001[7-8]I" ) ; if ( waitForAppToStart ) { server . waitForStringInLogUsingMark ( "CWWKZ0003I" ) ; } }
This method will the reset the log and trace marks for log and trace searches update the configuration and then wait for the server to re - initialize . Optionally it will then wait for the application to start .
164,273
public static void resetMarksInLogs ( LibertyServer server ) throws Exception { server . setMarkToEndOfLog ( server . getDefaultLogFile ( ) ) ; server . setMarkToEndOfLog ( server . getMostRecentTraceFile ( ) ) ; }
Reset the marks in all Liberty logs .
164,274
private void onHandlerEntry ( ) { if ( enabled ) { Type exceptionType = handlers . get ( handlerPendingInstruction ) ; handlerPendingInstruction = null ; Set < ProbeListener > filtered = new HashSet < ProbeListener > ( ) ; for ( ProbeListener listener : enabledListeners ) { ListenerConfiguration config = listener . getListenerConfiguration ( ) ; ProbeFilter filter = config . getTransformerData ( EXCEPTION_FILTER_KEY ) ; if ( filter . isBasicFilter ( ) && filter . basicClassNameMatches ( exceptionType . getClassName ( ) ) ) { filtered . add ( listener ) ; } else if ( filter . isAdvancedFilter ( ) ) { Class < ? > clazz = getOwningClass ( exceptionType . getInternalName ( ) ) ; if ( clazz != null && filter . matches ( clazz ) ) { filtered . add ( listener ) ; } } } if ( filtered . isEmpty ( ) ) { return ; } String key = createKey ( exceptionType ) ; ProbeImpl probe = getProbe ( key ) ; long probeId = probe . getIdentifier ( ) ; setProbeInProgress ( true ) ; visitInsn ( DUP ) ; visitLdcInsn ( Long . valueOf ( probeId ) ) ; visitInsn ( DUP2_X1 ) ; visitInsn ( POP2 ) ; if ( isStatic ( ) ) { visitInsn ( ACONST_NULL ) ; } else { visitVarInsn ( ALOAD , 0 ) ; } visitInsn ( SWAP ) ; visitInsn ( ACONST_NULL ) ; visitInsn ( SWAP ) ; visitFireProbeInvocation ( ) ; setProbeInProgress ( false ) ; setProbeListeners ( probe , filtered ) ; } }
Generate the code required to fire a probe out of an exception handler .
164,275
public static FileLock getFileLock ( java . io . RandomAccessFile file , String fileName ) throws java . io . IOException { return ( FileLock ) Utils . getImpl ( "com.ibm.ws.objectManager.utils.FileLockImpl" , new Class [ ] { java . io . RandomAccessFile . class , String . class } , new Object [ ] { file , fileName } ) ; }
Create a platform specific FileLock instance .
164,276
public static void initialize ( FacesContext context ) { if ( context . isProjectStage ( ProjectStage . Production ) ) { boolean initialize = true ; String elMode = WebConfigParamUtils . getStringInitParameter ( context . getExternalContext ( ) , FaceletCompositionContextImpl . INIT_PARAM_CACHE_EL_EXPRESSIONS , ELExpressionCacheMode . noCache . name ( ) ) ; if ( ! elMode . equals ( ELExpressionCacheMode . alwaysRecompile . name ( ) ) ) { Logger . getLogger ( ViewPoolProcessor . class . getName ( ) ) . log ( Level . INFO , FaceletCompositionContextImpl . INIT_PARAM_CACHE_EL_EXPRESSIONS + " web config parameter is set to \"" + ( ( elMode == null ) ? "none" : elMode ) + "\". To enable view pooling this param" + " must be set to \"alwaysRecompile\". View Pooling disabled." ) ; initialize = false ; } long refreshPeriod = WebConfigParamUtils . getLongInitParameter ( context . getExternalContext ( ) , FaceletViewDeclarationLanguage . PARAMS_REFRESH_PERIOD , FaceletViewDeclarationLanguage . DEFAULT_REFRESH_PERIOD_PRODUCTION ) ; if ( refreshPeriod != - 1 ) { Logger . getLogger ( ViewPoolProcessor . class . getName ( ) ) . log ( Level . INFO , ViewHandler . FACELETS_REFRESH_PERIOD_PARAM_NAME + " web config parameter is set to \"" + Long . toString ( refreshPeriod ) + "\". To enable view pooling this param" + " must be set to \"-1\". View Pooling disabled." ) ; initialize = false ; } if ( MyfacesConfig . getCurrentInstance ( context . getExternalContext ( ) ) . isStrictJsf2FaceletsCompatibility ( ) ) { Logger . getLogger ( ViewPoolProcessor . class . getName ( ) ) . log ( Level . INFO , MyfacesConfig . INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY + " web config parameter is set to \"" + "true" + "\". To enable view pooling this param " + " must be set to \"false\". View Pooling disabled." ) ; initialize = false ; } if ( initialize ) { ViewPoolProcessor processor = new ViewPoolProcessor ( context ) ; context . getExternalContext ( ) . getApplicationMap ( ) . put ( INSTANCE , processor ) ; } } }
This method should be called at startup to decide if a view processor should be provided or not to the runtime .
164,277
private void clearTransientAndNonFaceletComponents ( final FacesContext context , final UIComponent component ) { int childCount = component . getChildCount ( ) ; if ( childCount > 0 ) { for ( int i = 0 ; i < childCount ; i ++ ) { UIComponent child = component . getChildren ( ) . get ( i ) ; if ( child != null && child . isTransient ( ) && child . getAttributes ( ) . get ( ComponentSupport . MARK_CREATED ) == null ) { component . getChildren ( ) . remove ( i ) ; i -- ; childCount -- ; } else { if ( child . getChildCount ( ) > 0 || ! child . getFacets ( ) . isEmpty ( ) ) { clearTransientAndNonFaceletComponents ( context , child ) ; } } } } if ( component . getFacetCount ( ) > 0 ) { Map < String , UIComponent > facets = component . getFacets ( ) ; for ( Iterator < UIComponent > itr = facets . values ( ) . iterator ( ) ; itr . hasNext ( ) ; ) { UIComponent fc = itr . next ( ) ; if ( fc != null && fc . isTransient ( ) && fc . getAttributes ( ) . get ( ComponentSupport . MARK_CREATED ) == null ) { itr . remove ( ) ; } else { if ( fc . getChildCount ( ) > 0 || ! fc . getFacets ( ) . isEmpty ( ) ) { clearTransientAndNonFaceletComponents ( context , fc ) ; } } } } }
Clear all transient components not created by facelets algorithm . In this way we ensure the component tree does not have any changes done after markInitialState .
164,278
public void destroy ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "destroy" , this ) ; if ( tsr . getTransactionKey ( ) != null ) { final Map < String , InstanceAndContext < ? > > storage = getStorage ( false ) ; if ( storage != null ) { try { for ( InstanceAndContext < ? > entry : storage . values ( ) ) { final String id = getContextualId ( entry . context ) ; destroyItem ( id , entry ) ; } } finally { tsr . putResource ( TXC_STORAGE_ID , null ) ; } } } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Tran synchronization registry not available, skipping destroy" ) ; } beanManager . fireEvent ( "Destroying transaction context" , destroyedQualifier ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "destroy" ) ; }
Destroy the entire context . This causes
164,279
public void doPrePhaseActions ( FacesContext facesContext ) { if ( ! _flashScopeDisabled ) { final PhaseId currentPhaseId = facesContext . getCurrentPhaseId ( ) ; if ( PhaseId . RESTORE_VIEW . equals ( currentPhaseId ) ) { _restoreRedirectValue ( facesContext ) ; _manageFlashMapTokens ( facesContext ) ; _restoreMessages ( facesContext ) ; } } }
Used to restore the redirect value and the FacesMessages of the previous request and to manage the flashMap tokens for this request before phase restore view starts .
164,280
public boolean isRedirect ( ) { FacesContext facesContext = FacesContext . getCurrentInstance ( ) ; boolean thisRedirect = _isRedirectTrueOnThisRequest ( facesContext ) ; boolean prevRedirect = _isRedirectTrueOnPreviousRequest ( facesContext ) ; boolean executePhase = ! PhaseId . RENDER_RESPONSE . equals ( facesContext . getCurrentPhaseId ( ) ) ; return thisRedirect || ( executePhase && prevRedirect ) ; }
Return the value of this property for the flash for this session .
164,281
public void keep ( String key ) { _checkFlashScopeDisabled ( ) ; FacesContext facesContext = FacesContext . getCurrentInstance ( ) ; Map < String , Object > requestMap = facesContext . getExternalContext ( ) . getRequestMap ( ) ; Object value = requestMap . get ( key ) ; if ( value == null ) { Map < String , Object > executeMap = _getExecuteFlashMap ( facesContext ) ; if ( executeMap != null ) { value = executeMap . get ( key ) ; requestMap . put ( key , value ) ; } } _getRenderFlashMap ( facesContext ) . put ( key , value ) ; facesContext . getApplication ( ) . publishEvent ( facesContext , PostKeepFlashValueEvent . class , key ) ; }
Take a value from the requestMap or if it does not exist from the execute FlashMap and put it on the render FlashMap so it is visible on the next request .
164,282
public void putNow ( String key , Object value ) { _checkFlashScopeDisabled ( ) ; FacesContext . getCurrentInstance ( ) . getExternalContext ( ) . getRequestMap ( ) . put ( key , value ) ; }
This is just an alias for the request scope map .
164,283
public void setKeepMessages ( boolean keepMessages ) { FacesContext facesContext = FacesContext . getCurrentInstance ( ) ; ExternalContext externalContext = facesContext . getExternalContext ( ) ; Map < String , Object > requestMap = externalContext . getRequestMap ( ) ; requestMap . put ( FLASH_KEEP_MESSAGES , keepMessages ) ; }
If this property is true the messages should be kept for the next request no matter if it is a normal postback case or a POST - REDIRECT - GET case .
164,284
@ SuppressWarnings ( "unchecked" ) private void _restoreMessages ( FacesContext facesContext ) { List < MessageEntry > messageList = ( List < MessageEntry > ) _getExecuteFlashMap ( facesContext ) . get ( FLASH_KEEP_MESSAGES_LIST ) ; if ( messageList != null ) { Iterator < MessageEntry > iterMessages = messageList . iterator ( ) ; while ( iterMessages . hasNext ( ) ) { MessageEntry entry = iterMessages . next ( ) ; facesContext . addMessage ( entry . clientId , entry . message ) ; } _getExecuteFlashMap ( facesContext ) . remove ( FLASH_KEEP_MESSAGES_LIST ) ; } }
Restore any saved FacesMessages from the previous request . Note that we don t need to save the keepMessages value for this request because we just have to check if the value for FLASH_KEEP_MESSAGES_LIST exists .
164,285
private void _saveRenderFlashMapTokenForNextRequest ( FacesContext facesContext ) { ExternalContext externalContext = facesContext . getExternalContext ( ) ; String tokenValue = ( String ) externalContext . getRequestMap ( ) . get ( FLASH_RENDER_MAP_TOKEN ) ; ClientWindow clientWindow = externalContext . getClientWindow ( ) ; if ( clientWindow != null ) { if ( facesContext . getApplication ( ) . getStateManager ( ) . isSavingStateInClient ( facesContext ) ) { Map < String , Object > sessionMap = externalContext . getSessionMap ( ) ; sessionMap . put ( FLASH_RENDER_MAP_TOKEN + SEPARATOR_CHAR + clientWindow . getId ( ) , tokenValue ) ; } else { FlashClientWindowTokenCollection lruMap = getFlashClientWindowTokenCollection ( externalContext , true ) ; lruMap . put ( clientWindow . getId ( ) , tokenValue ) ; } } else { HttpServletResponse httpResponse = ExternalContextUtils . getHttpServletResponse ( externalContext ) ; if ( httpResponse != null ) { Cookie cookie = _createFlashCookie ( FLASH_RENDER_MAP_TOKEN , tokenValue , externalContext ) ; httpResponse . addCookie ( cookie ) ; } else { Map < String , Object > sessionMap = externalContext . getSessionMap ( ) ; sessionMap . put ( FLASH_RENDER_MAP_TOKEN , tokenValue ) ; } } }
Take the render map key and store it as a key for the next request .
164,286
private String _getRenderFlashMapTokenFromPreviousRequest ( FacesContext facesContext ) { ExternalContext externalContext = facesContext . getExternalContext ( ) ; String tokenValue = null ; ClientWindow clientWindow = externalContext . getClientWindow ( ) ; if ( clientWindow != null ) { if ( facesContext . getApplication ( ) . getStateManager ( ) . isSavingStateInClient ( facesContext ) ) { Map < String , Object > sessionMap = externalContext . getSessionMap ( ) ; tokenValue = ( String ) sessionMap . get ( FLASH_RENDER_MAP_TOKEN + SEPARATOR_CHAR + clientWindow . getId ( ) ) ; } else { FlashClientWindowTokenCollection lruMap = getFlashClientWindowTokenCollection ( externalContext , false ) ; if ( lruMap != null ) { tokenValue = ( String ) lruMap . get ( clientWindow . getId ( ) ) ; } } } else { HttpServletResponse httpResponse = ExternalContextUtils . getHttpServletResponse ( externalContext ) ; if ( httpResponse != null ) { Cookie cookie = ( Cookie ) externalContext . getRequestCookieMap ( ) . get ( FLASH_RENDER_MAP_TOKEN ) ; if ( cookie != null ) { tokenValue = cookie . getValue ( ) ; } } else { Map < String , Object > sessionMap = externalContext . getSessionMap ( ) ; tokenValue = ( String ) sessionMap . get ( FLASH_RENDER_MAP_TOKEN ) ; } } return tokenValue ; }
Retrieve the map token of the render map from the previous request .
164,287
@ SuppressWarnings ( "unchecked" ) private Map < String , Object > _getRenderFlashMap ( FacesContext context ) { Map < String , Object > requestMap = context . getExternalContext ( ) . getRequestMap ( ) ; Map < String , Object > map = ( Map < String , Object > ) requestMap . get ( FLASH_RENDER_MAP ) ; if ( map == null ) { String token = ( String ) requestMap . get ( FLASH_RENDER_MAP_TOKEN ) ; String fullToken = FLASH_SESSION_MAP_SUBKEY_PREFIX + SEPARATOR_CHAR + token + SEPARATOR_CHAR ; map = _createSubKeyMap ( context , fullToken ) ; requestMap . put ( FLASH_RENDER_MAP , map ) ; } return map ; }
Return the flash map created on this traversal .
164,288
@ SuppressWarnings ( "unchecked" ) private Map < String , Object > _getExecuteFlashMap ( FacesContext context ) { Map < String , Object > requestMap = context . getExternalContext ( ) . getRequestMap ( ) ; Map < String , Object > map = ( Map < String , Object > ) requestMap . get ( FLASH_EXECUTE_MAP ) ; if ( map == null ) { String token = ( String ) requestMap . get ( FLASH_EXECUTE_MAP_TOKEN ) ; String fullToken = FLASH_SESSION_MAP_SUBKEY_PREFIX + SEPARATOR_CHAR + token + SEPARATOR_CHAR ; map = _createSubKeyMap ( context , fullToken ) ; requestMap . put ( FLASH_EXECUTE_MAP , map ) ; } return map ; }
Return the execute Flash Map .
164,289
private void _clearExecuteFlashMap ( FacesContext facesContext ) { Map < String , Object > map = _getExecuteFlashMap ( facesContext ) ; if ( ! map . isEmpty ( ) ) { facesContext . getApplication ( ) . publishEvent ( facesContext , PreClearFlashEvent . class , map ) ; map . clear ( ) ; } }
Destroy the execute FlashMap because it is not needed anymore .
164,290
private Cookie _createFlashCookie ( String name , String value , ExternalContext externalContext ) { Cookie cookie = new Cookie ( name , value ) ; cookie . setMaxAge ( - 1 ) ; cookie . setPath ( _getCookiePath ( externalContext ) ) ; cookie . setSecure ( externalContext . isSecure ( ) ) ; if ( ServletSpecifications . isServlet30Available ( ) ) { _Servlet30Utils . setCookieHttpOnly ( cookie , true ) ; } return cookie ; }
Creates a Cookie with the given name and value . In addition it will be configured with maxAge = - 1 the current request path and secure value .
164,291
private String _getCookiePath ( ExternalContext externalContext ) { String contextPath = externalContext . getRequestContextPath ( ) ; if ( contextPath == null || "" . equals ( contextPath ) ) { contextPath = "/" ; } return contextPath ; }
Returns the path for the Flash - Cookies .
164,292
private Boolean _convertToBoolean ( Object value ) { Boolean booleanValue ; if ( value instanceof Boolean ) { booleanValue = ( Boolean ) value ; } else { booleanValue = Boolean . parseBoolean ( value . toString ( ) ) ; } return booleanValue ; }
Convert the Object to a Boolean .
164,293
@ FFDCIgnore ( NumberFormatException . class ) public static Long evaluateDuration ( String strVal , TimeUnit endUnit ) { try { return Long . valueOf ( strVal ) ; } catch ( NumberFormatException ex ) { } return evaluateDuration ( strVal , endUnit , UNIT_DESCRIPTORS ) ; }
Converts a string value representing a unit of time into a Long value .
164,294
private static String collapseWhitespace ( String value ) { final int length = value . length ( ) ; for ( int i = 0 ; i < length ; ++ i ) { if ( isSpace ( value . charAt ( i ) ) ) { return collapse0 ( value , i , length ) ; } } return value ; }
Collapses contiguous sequences of whitespace to a single 0x20 . Leading and trailing whitespace is removed .
164,295
public void stop ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "CommsInboundChain Stop" ) ; try { ChainData cd = _cfw . getChain ( _chainName ) ; if ( cd != null ) { _cfw . stopChain ( cd , _cfw . getDefaultChainQuiesceTimeout ( ) ) ; stopWait . waitForStop ( _cfw . getDefaultChainQuiesceTimeout ( ) ) ; _cfw . destroyChain ( cd ) ; _cfw . removeChain ( cd ) ; } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Failed in successfully cleaning(i.e stopping/destorying/removing) chain: " , e ) ; } finally { _isChainStarted = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "CommsServerServiceFacade JfapChainStop" ) ; }
stop will get called only from de - activate .
164,296
private boolean shouldDeferToJwtSso ( HttpServletRequest req , MicroProfileJwtConfig config , MicroProfileJwtConfig jwtssoConfig ) { if ( ( ! isJwtSsoFeatureActive ( config ) ) && ( jwtssoConfig == null ) ) { return false ; } String hdrValue = req . getHeader ( Authorization_Header ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Authorization header=" , hdrValue ) ; } boolean haveValidBearerHeader = ( hdrValue != null && hdrValue . startsWith ( "Bearer " ) ) ; return ! haveValidBearerHeader ; }
if we don t have a valid bearer header and jwtsso is active we should defer .
164,297
protected boolean matches ( File f , boolean isFile ) { if ( fileFilter != null ) { if ( isFile && directoriesOnly ) { return false ; } else if ( ! isFile && filesOnly ) { return false ; } else if ( fileNameRegex != null ) { Matcher m = fileNameRegex . matcher ( f . getName ( ) ) ; if ( ! m . matches ( ) ) { return false ; } } } return true ; }
Check to see if this is a resource we re monitoring based on the filter configuration
164,298
public Object remove ( Object key ) { synchronized ( _cacheL2 ) { if ( ! _cacheL1 . containsKey ( key ) && ! _cacheL2 . containsKey ( key ) ) { return null ; } Object retval ; Map newMap ; synchronized ( _cacheL1 ) { newMap = HashMapUtils . merge ( _cacheL1 , _cacheL2 ) ; retval = newMap . remove ( key ) ; } _cacheL1 = newMap ; _cacheL2 . clear ( ) ; _missCount = 0 ; return retval ; } }
This operation is very expensive . A full copy of the Map is created
164,299
public void complete ( VirtualConnection vc , TCPWriteRequestContext wsc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "complete() called: vc=" + vc ) ; } HttpOutboundServiceContextImpl mySC = ( HttpOutboundServiceContextImpl ) vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPOSC ) ; if ( mySC . isEarlyRead ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Notifying app channel of write complete" ) ; } mySC . getAppWriteCallback ( ) . complete ( vc ) ; return ; } if ( mySC . isHeadersSentState ( ) && 0 == mySC . getNumBytesWritten ( ) ) { if ( mySC . shouldReadResponseImmediately ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Sent headers, reading for response" ) ; } mySC . startResponseRead ( ) ; return ; } } if ( ! mySC . isMessageSent ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Calling write complete callback of app channel." ) ; } mySC . getAppWriteCallback ( ) . complete ( vc ) ; } else { if ( mySC . shouldReadResponseImmediately ( ) ) { mySC . readAsyncResponse ( ) ; } else { mySC . startResponseRead ( ) ; } } }
Called by the TCP channel when the write has finished .