idx
int64 0
41.2k
| question
stringlengths 83
4.15k
| target
stringlengths 5
715
|
|---|---|---|
35,400
|
private void addUpstreamCommittersTriggeringBuild ( Run < ? , ? > build , Set < InternetAddress > to , Set < InternetAddress > cc , Set < InternetAddress > bcc , EnvVars env , final ExtendedEmailPublisherContext context , RecipientProviderUtilities . IDebug debug ) { debug . send ( "Adding upstream committer from job %s with build number %s" , build . getParent ( ) . getDisplayName ( ) , build . getNumber ( ) ) ; List < ChangeLogSet < ? > > changeSets = new ArrayList < > ( ) ; if ( build instanceof AbstractBuild < ? , ? > ) { AbstractBuild < ? , ? > b = ( AbstractBuild < ? , ? > ) build ; changeSets . add ( b . getChangeSet ( ) ) ; } else { try { Method m = build . getClass ( ) . getMethod ( "getChangeSets" ) ; changeSets = ( List < ChangeLogSet < ? extends ChangeLogSet . Entry > > ) m . invoke ( build ) ; } catch ( NoSuchMethodException | InvocationTargetException | IllegalAccessException e ) { context . getListener ( ) . getLogger ( ) . print ( "Could not add upstream committers, build type does not provide change set" ) ; } } if ( ! changeSets . isEmpty ( ) ) { for ( ChangeLogSet < ? extends ChangeLogSet . Entry > changeSet : changeSets ) { for ( ChangeLogSet . Entry change : changeSet ) { addUserFromChangeSet ( change , to , cc , bcc , env , context , debug ) ; } } } }
|
Adds for the given upstream build the committers to the recipient list for each commit in the upstream build .
|
35,401
|
private void addUserFromChangeSet ( ChangeLogSet . Entry change , Set < InternetAddress > to , Set < InternetAddress > cc , Set < InternetAddress > bcc , EnvVars env , final ExtendedEmailPublisherContext context , RecipientProviderUtilities . IDebug debug ) { User user = change . getAuthor ( ) ; RecipientProviderUtilities . addUsers ( Collections . singleton ( user ) , context , env , to , cc , bcc , debug ) ; }
|
Adds a user to the recipients list based on a specific SCM change set
|
35,402
|
private String fetchStyles ( Document doc ) { Elements els = doc . select ( STYLE_TAG ) ; StringBuilder styles = new StringBuilder ( ) ; for ( Element e : els ) { if ( e . attr ( "data-inline" ) . equals ( "true" ) ) { styles . append ( e . data ( ) ) ; e . remove ( ) ; } } return styles . toString ( ) ; }
|
Generates a stylesheet from an html document
|
35,403
|
public String process ( String input ) { Document doc = Jsoup . parse ( input ) ; Elements elements = doc . getElementsByAttributeValue ( DATA_INLINE_ATTR , "true" ) ; if ( elements . isEmpty ( ) ) { return input ; } extractStyles ( doc ) ; applyStyles ( doc ) ; inlineImages ( doc ) ; doc . outputSettings ( doc . outputSettings ( ) . syntax ( Document . OutputSettings . Syntax . xml ) . prettyPrint ( false ) . escapeMode ( Entities . EscapeMode . extended ) ) ; return StringEscapeUtils . unescapeHtml ( doc . outerHtml ( ) ) ; }
|
Takes an input string representing an html document and processes it with the Css Inliner .
|
35,404
|
public static String unescapeString ( String escapedString ) { StringBuilder sb = new StringBuilder ( ) ; for ( int i = 1 ; i < escapedString . length ( ) - 1 ; ++ i ) { char c = escapedString . charAt ( i ) ; if ( c == '\\' ) { ++ i ; sb . append ( unescapeChar ( escapedString . charAt ( i ) ) ) ; } else { sb . append ( c ) ; } } return sb . toString ( ) ; }
|
Replaces all the printf - style escape sequences in a string with the appropriate characters .
|
35,405
|
public static void printf ( StringBuffer buf , String formatString , PrintfSpec printfSpec ) { for ( int i = 0 ; i < formatString . length ( ) ; ++ i ) { char c = formatString . charAt ( i ) ; if ( ( c == '%' ) && ( i + 1 < formatString . length ( ) ) ) { ++ i ; char code = formatString . charAt ( i ) ; if ( code == '%' ) { buf . append ( '%' ) ; } else { boolean handled = printfSpec . printSpec ( buf , code ) ; if ( ! handled ) { buf . append ( '%' ) ; buf . append ( code ) ; } } } else if ( ( c == '\\' ) && ( i + 1 < formatString . length ( ) ) ) { ++ i ; buf . append ( Util . unescapeChar ( formatString . charAt ( i ) ) ) ; } else { buf . append ( c ) ; } } }
|
Formats a string and puts the result into a StringBuffer . Allows for standard Java backslash escapes and a customized behavior for % escapes in the form of a PrintfSpec .
|
35,406
|
private ClassLoader expandClasspath ( ExtendedEmailPublisherContext context , ClassLoader loader ) throws IOException { List < ClasspathEntry > classpathList = new ArrayList < > ( ) ; if ( classpath != null && ! classpath . isEmpty ( ) ) { transformToClasspathEntries ( classpath , context , classpathList ) ; } List < GroovyScriptPath > globalClasspath = getDescriptor ( ) . getDefaultClasspath ( ) ; if ( globalClasspath != null && ! globalClasspath . isEmpty ( ) ) { transformToClasspathEntries ( globalClasspath , context , classpathList ) ; } boolean useSecurity = Jenkins . getActiveInstance ( ) . isUseSecurity ( ) ; if ( ! classpathList . isEmpty ( ) ) { GroovyClassLoader gloader = new GroovyClassLoader ( loader ) ; gloader . setShouldRecompile ( true ) ; for ( ClasspathEntry entry : classpathList ) { if ( useSecurity ) { ScriptApproval . get ( ) . using ( entry ) ; } gloader . addURL ( entry . getURL ( ) ) ; } loader = gloader ; } if ( useSecurity ) { return GroovySandbox . createSecureClassLoader ( loader ) ; } else { return loader ; } }
|
Expand the plugin class loader with URL taken from the project descriptor and the global configuration .
|
35,407
|
protected int getNumFailures ( Run < ? , ? > build ) { AbstractTestResultAction a = build . getAction ( AbstractTestResultAction . class ) ; if ( a instanceof AggregatedTestResultAction ) { int result = 0 ; AggregatedTestResultAction action = ( AggregatedTestResultAction ) a ; for ( ChildReport cr : action . getChildReports ( ) ) { if ( cr == null || cr . child == null || cr . child . getParent ( ) == null ) { continue ; } if ( cr . child . getParent ( ) . equals ( build . getParent ( ) ) ) { if ( cr . result instanceof TestResult ) { TestResult tr = ( TestResult ) cr . result ; result += tr . getFailCount ( ) ; } } } if ( result == 0 && action . getFailCount ( ) > 0 ) { result = action . getFailCount ( ) ; } return result ; } return a . getFailCount ( ) ; }
|
Determine the number of direct failures in the given build . If it aggregates downstream results ignore contributed failures . This is because at the time this trigger runs the current build s aggregated results aren t available yet but those of the previous build may be .
|
35,408
|
private Run < ? , ? > getPreviousRun ( Run < ? , ? > build , TaskListener listener ) { Run < ? , ? > prevBuild = ExtendedEmailPublisher . getPreviousRun ( build , listener ) ; if ( prevBuild != null && prevBuild . getResult ( ) == Result . ABORTED ) { return getPreviousRun ( prevBuild , listener ) ; } return prevBuild ; }
|
Find most recent previous build matching certain criteria .
|
35,409
|
public static void setDnsCache ( long expireMillis , String host , String ... ips ) { try { InetAddressCacheUtil . setInetAddressCache ( host , ips , System . currentTimeMillis ( ) + expireMillis ) ; } catch ( Exception e ) { final String message = String . format ( "Fail to setDnsCache for host %s ip %s expireMillis %s, cause: %s" , host , Arrays . toString ( ips ) , expireMillis , e . toString ( ) ) ; throw new DnsCacheManipulatorException ( message , e ) ; } }
|
Set a dns cache entry .
|
35,410
|
public static void setDnsCache ( Properties properties ) { for ( Map . Entry < Object , Object > entry : properties . entrySet ( ) ) { final String host = ( String ) entry . getKey ( ) ; String ipList = ( String ) entry . getValue ( ) ; ipList = ipList . trim ( ) ; if ( ipList . isEmpty ( ) ) continue ; final String [ ] ips = COMMA_SEPARATOR . split ( ipList ) ; setDnsCache ( host , ips ) ; } }
|
Set dns cache entries by properties
|
35,411
|
public static void loadDnsCacheConfig ( String propertiesFileName ) { InputStream inputStream = Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( propertiesFileName ) ; if ( inputStream == null ) { inputStream = DnsCacheManipulator . class . getClassLoader ( ) . getResourceAsStream ( propertiesFileName ) ; } if ( inputStream == null ) { throw new DnsCacheManipulatorException ( "Fail to find " + propertiesFileName + " on classpath!" ) ; } try { Properties properties = new Properties ( ) ; properties . load ( inputStream ) ; inputStream . close ( ) ; setDnsCache ( properties ) ; } catch ( Exception e ) { final String message = String . format ( "Fail to loadDnsCacheConfig from %s, cause: %s" , propertiesFileName , e . toString ( ) ) ; throw new DnsCacheManipulatorException ( message , e ) ; } }
|
Load dns config from the specified properties file on classpath then set dns cache .
|
35,412
|
public static DnsCacheEntry getDnsCache ( String host ) { try { return InetAddressCacheUtil . getInetAddressCache ( host ) ; } catch ( Exception e ) { throw new DnsCacheManipulatorException ( "Fail to getDnsCache, cause: " + e . toString ( ) , e ) ; } }
|
Get dns cache .
|
35,413
|
public static List < DnsCacheEntry > listDnsCache ( ) { try { return InetAddressCacheUtil . listInetAddressCache ( ) . getCache ( ) ; } catch ( Exception e ) { throw new DnsCacheManipulatorException ( "Fail to listDnsCache, cause: " + e . toString ( ) , e ) ; } }
|
Get all dns cache entries .
|
35,414
|
public static DnsCache getWholeDnsCache ( ) { try { return InetAddressCacheUtil . listInetAddressCache ( ) ; } catch ( Exception e ) { throw new DnsCacheManipulatorException ( "Fail to getWholeDnsCache, cause: " + e . toString ( ) , e ) ; } }
|
Get whole dns cache info .
|
35,415
|
public static void removeDnsCache ( String host ) { try { InetAddressCacheUtil . removeInetAddressCache ( host ) ; } catch ( Exception e ) { final String message = String . format ( "Fail to removeDnsCache for host %s, cause: %s" , host , e . toString ( ) ) ; throw new DnsCacheManipulatorException ( message , e ) ; } }
|
Remove dns cache entry cause lookup dns server for host after .
|
35,416
|
public static void setDnsNegativeCachePolicy ( int negativeCacheSeconds ) { try { InetAddressCacheUtil . setDnsNegativeCachePolicy ( negativeCacheSeconds ) ; } catch ( Exception e ) { throw new DnsCacheManipulatorException ( "Fail to setDnsNegativeCachePolicy, cause: " + e . toString ( ) , e ) ; } }
|
Set JVM DNS negative cache policy
|
35,417
|
private void initializeDrawableForDisplay ( Drawable d ) { if ( mBlockInvalidateCallback == null ) { mBlockInvalidateCallback = new BlockInvalidateCallback ( ) ; } d . setCallback ( mBlockInvalidateCallback . wrap ( d . getCallback ( ) ) ) ; try { if ( mDrawableContainerState . mEnterFadeDuration <= 0 && mHasAlpha ) { d . setAlpha ( mAlpha ) ; } if ( mDrawableContainerState . mHasColorFilter ) { d . setColorFilter ( mDrawableContainerState . mColorFilter ) ; } else { if ( mDrawableContainerState . mHasTintList ) { DrawableCompat . setTintList ( d , mDrawableContainerState . mTintList ) ; } if ( mDrawableContainerState . mHasTintMode ) { DrawableCompat . setTintMode ( d , mDrawableContainerState . mTintMode ) ; } } d . setVisible ( isVisible ( ) , true ) ; d . setDither ( mDrawableContainerState . mDither ) ; d . setState ( getState ( ) ) ; d . setLevel ( getLevel ( ) ) ; d . setBounds ( getBounds ( ) ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . M ) { d . setLayoutDirection ( getLayoutDirection ( ) ) ; } if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . KITKAT ) { d . setAutoMirrored ( mDrawableContainerState . mAutoMirrored ) ; } final Rect hotspotBounds = mHotspotBounds ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP && hotspotBounds != null ) { d . setHotspotBounds ( hotspotBounds . left , hotspotBounds . top , hotspotBounds . right , hotspotBounds . bottom ) ; } } finally { d . setCallback ( mBlockInvalidateCallback . unwrap ( ) ) ; } }
|
Initializes a drawable for display in this container .
|
35,418
|
protected boolean onStateChange ( int [ ] stateSet ) { final boolean changed = super . onStateChange ( stateSet ) ; int idx = mAnimationScaleListState . getCurrentDrawableIndexBasedOnScale ( ) ; return selectDrawable ( idx ) || changed ; }
|
Set the current drawable according to the animation scale . If scale is 0 then pick the static drawable otherwise pick the animatable drawable .
|
35,419
|
public static int longToInt ( long inLong ) { if ( inLong < Integer . MIN_VALUE ) { return Integer . MIN_VALUE ; } if ( inLong > Integer . MAX_VALUE ) { return Integer . MAX_VALUE ; } return ( int ) inLong ; }
|
convert unsigned long to signed int .
|
35,420
|
public static void getAllInterfaces ( Class < ? > classObject , ArrayList < Type > interfaces ) { Type [ ] superInterfaces = classObject . getGenericInterfaces ( ) ; interfaces . addAll ( ( Arrays . asList ( superInterfaces ) ) ) ; Type tgs = classObject . getGenericSuperclass ( ) ; if ( tgs != null ) { if ( ( tgs ) instanceof ParameterizedType ) { interfaces . add ( tgs ) ; } } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "updated interfaces to: " + interfaces ) ; } Class < ? > superClass = classObject . getSuperclass ( ) ; if ( superClass != null ) { getAllInterfaces ( superClass , interfaces ) ; } }
|
recursively gets all interfaces
|
35,421
|
public static String truncateCloseReason ( String reasonPhrase ) { if ( reasonPhrase != null ) { byte [ ] reasonBytes = reasonPhrase . getBytes ( Utils . UTF8_CHARSET ) ; int len = reasonBytes . length ; if ( len > 120 ) { String updatedPhrase = cutStringByByteSize ( reasonPhrase , 120 ) ; reasonPhrase = updatedPhrase ; } } return reasonPhrase ; }
|
close reason needs to be truncated to 123 UTF - 8 encoded bytes
|
35,422
|
protected Converter getConverter ( FacesContext facesContext , UIComponent component ) { if ( component instanceof UISelectMany ) { return HtmlRendererUtils . findUISelectManyConverterFailsafe ( facesContext , ( UISelectMany ) component ) ; } else if ( component instanceof UISelectOne ) { return HtmlRendererUtils . findUIOutputConverterFailSafe ( facesContext , component ) ; } return null ; }
|
Gets the converter for the given component rendered by this renderer .
|
35,423
|
public void startConditional ( ) throws Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "startConditional" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Activating MBean for ME " + getName ( ) ) ; setState ( STATE_STARTING ) ; start ( JsConstants . ME_START_DEFAULT ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "startConditional" ) ; }
|
Start the Messaging Engine if it is enabled
|
35,424
|
private boolean okayToSendServerStarted ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "okayToSendServerStarted" , this ) ; synchronized ( lockObject ) { if ( ! _sentServerStarted ) { if ( ( _state == STATE_STARTED ) && _mainImpl . isServerStarted ( ) ) { _sentServerStarted = true ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "okayToSendServerStarted" , new Boolean ( _sentServerStarted ) ) ; return _sentServerStarted ; }
|
Determine whether the conditions permitting a server started notification to be sent are met .
|
35,425
|
private boolean okayToSendServerStopping ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "okayToSendServerStopping" , this ) ; synchronized ( lockObject ) { if ( ! _sentServerStopping ) { if ( ( _state == STATE_STARTED || _state == STATE_AUTOSTARTING || _state == STATE_STARTING ) && _mainImpl . isServerStopping ( ) ) { _sentServerStopping = true ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "okayToSendServerStopping" , new Boolean ( _sentServerStopping ) ) ; return _sentServerStopping ; }
|
Determine whether the conditions permitting a server stopping notification to be sent are met . The ME state can be STARTED AUTOSTARTING or in STARTING state to receive server stopping notification
|
35,426
|
@ SuppressWarnings ( "unchecked" ) public < EngineComponent > EngineComponent getEngineComponent ( Class < EngineComponent > clazz ) { String thisMethodName = "getEngineComponent" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , clazz ) ; } JsEngineComponent foundEngineComponent = null ; Iterator < ComponentList > vIter = jmeComponents . iterator ( ) ; while ( vIter . hasNext ( ) && foundEngineComponent == null ) { ComponentList c = vIter . next ( ) ; if ( clazz . isInstance ( c . getRef ( ) ) ) { foundEngineComponent = c . getRef ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , foundEngineComponent ) ; } return ( EngineComponent ) foundEngineComponent ; }
|
The purpose of this method is to get an engine component that can be cast using the specified class . The EngineComponent is not a class name but represents the classes real type .
|
35,427
|
@ SuppressWarnings ( "unchecked" ) public < EngineComponent > EngineComponent [ ] getEngineComponents ( Class < EngineComponent > clazz ) { String thisMethodName = "getEngineComponents" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , clazz ) ; } List < EngineComponent > foundComponents = new ArrayList < EngineComponent > ( ) ; Iterator < ComponentList > vIter = jmeComponents . iterator ( ) ; while ( vIter . hasNext ( ) ) { JsEngineComponent ec = vIter . next ( ) . getRef ( ) ; if ( clazz . isInstance ( ec ) ) { foundComponents . add ( ( EngineComponent ) ec ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , foundComponents ) ; } return foundComponents . toArray ( ( EngineComponent [ ] ) Array . newInstance ( clazz , 0 ) ) ; }
|
The purpose of this method is to get an engine component that can be cast using the specified class . The EngineComponent is not a class name but represents the classes real type . It is not possible to create an Array of a generic type without using reflection .
|
35,428
|
public final JsMEConfig getMeConfig ( ) { String thisMethodName = "getMeConfig" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , this ) ; SibTr . exit ( tc , thisMethodName , _me ) ; } return _me ; }
|
Returns a reference to this messaging engine s configuration .
|
35,429
|
public JsEngineComponent getMessageProcessor ( String name ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getMessageProcessor" , this ) ; SibTr . exit ( tc , "getMessageProcessor" , _messageProcessor ) ; } return _messageProcessor ; }
|
Gets the instance of the MP associated with this ME
|
35,430
|
private void resolveExceptionDestination ( BaseDestinationDefinition dd ) { String thisMethodName = "resolveExceptionDestination" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , dd . getName ( ) ) ; } if ( dd . isLocal ( ) ) { String ed = ( ( DestinationDefinition ) dd ) . getExceptionDestination ( ) ; if ( ( ed != null ) && ( ed . equals ( JsConstants . DEFAULT_EXCEPTION_DESTINATION ) ) ) { ( ( DestinationDefinition ) dd ) . setExceptionDestination ( JsConstants . EXCEPTION_DESTINATION_PREFIX + this . getName ( ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName ) ; } }
|
Resolve if necessary a variable Exception Destination name in the specified DD to it s runtime value .
|
35,431
|
BaseDestinationDefinition getSIBDestinationByUuid ( String bus , String key , boolean newCache ) throws SIBExceptionDestinationNotFound , SIBExceptionBase { String thisMethodName = "getSIBDestinationByUuid" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , new Object [ ] { bus , key , new Boolean ( newCache ) } ) ; } BaseDestinationDefinition bdd = null ; if ( oldDestCache == null || newCache ) { bdd = ( BaseDestinationDefinition ) _bus . getDestinationCache ( ) . getSIBDestinationByUuid ( bus , key ) . clone ( ) ; } else { bdd = ( BaseDestinationDefinition ) oldDestCache . getSIBDestinationByUuid ( bus , key ) . clone ( ) ; } resolveExceptionDestination ( bdd ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , bdd ) ; } return bdd ; }
|
Accessor method to return a destination definition .
|
35,432
|
public final String getState ( ) { String thisMethodName = "getState" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , this ) ; SibTr . exit ( tc , thisMethodName , states [ _state ] ) ; } return states [ _state ] ; }
|
Get the state of this ME
|
35,433
|
public final boolean isStarted ( ) { String thisMethodName = "isStarted" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , this ) ; } boolean retVal = ( _state == STATE_STARTED ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , Boolean . toString ( retVal ) ) ; } return retVal ; }
|
Returns an indication of whether this ME is started or not
|
35,434
|
final boolean addLocalizationPoint ( LWMConfig lp , DestinationDefinition dd ) { String thisMethodName = "addLocalizationPoint" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , lp ) ; } boolean success = _localizer . addLocalizationPoint ( lp , dd ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , Boolean . valueOf ( success ) ) ; } return success ; }
|
Pass the request to add a new localization point onto the localizer object .
|
35,435
|
final void alterLocalizationPoint ( BaseDestination dest , LWMConfig lp ) { String thisMethodName = "alterLocalizationPoint" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , lp ) ; } try { _localizer . alterLocalizationPoint ( dest , lp ) ; } catch ( Exception e ) { SibTr . exception ( tc , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName ) ; } }
|
Pass the request to alter a localization point onto the localizer object .
|
35,436
|
final void deleteLocalizationPoint ( JsBus bus , LWMConfig dest ) { String thisMethodName = "deleteLocalizationPoint" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , dest ) ; } try { _localizer . deleteLocalizationPoint ( bus , dest ) ; } catch ( SIBExceptionBase ex ) { SibTr . exception ( tc , ex ) ; } catch ( SIException e ) { SibTr . exception ( tc , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName ) ; } }
|
Pass the request to delete a localization point onto the localizer object .
|
35,437
|
final void setLPConfigObjects ( List config ) { String thisMethodName = "setLPConfigObjects" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , "Number of LPs =" + config . size ( ) ) ; } _lpConfig . clear ( ) ; _lpConfig . addAll ( config ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName ) ; } }
|
Update the cache of localization point config objects . This method is used by dynamic config to refresh the cache .
|
35,438
|
public boolean isEventNotificationPropertySet ( ) { String thisMethodName = "isEventNotificationPropertySet" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , this ) ; } boolean enabled = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , Boolean . toString ( enabled ) ) ; } return enabled ; }
|
Test whether the Event Notification property has been set . This method resolves the setting for the specific ME and the setting for the bus .
|
35,439
|
public JsMainImpl getMainImpl ( ) { String thisMethodName = "getMainImpl" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , this ) ; SibTr . exit ( tc , thisMethodName , _mainImpl ) ; } return _mainImpl ; }
|
Returns a reference to the repository service . This is used in conjunction with ConfigRoot to access EMF configuration documents .
|
35,440
|
protected final JsEngineComponent loadClass ( String className , int stopSeq , boolean reportError ) { String thisMethodName = "loadClass" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , new Object [ ] { className , Integer . toString ( stopSeq ) , Boolean . toString ( reportError ) } ) ; } Class myClass = null ; JsEngineComponent retValue = null ; int _seq = stopSeq ; if ( _seq < 0 || _seq > NUM_STOP_PHASES ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "loadClass: stopSeq is out of bounds " + stopSeq ) ; } else { try { myClass = Class . forName ( className ) ; retValue = ( JsEngineComponent ) myClass . newInstance ( ) ; ComponentList compList = new ComponentList ( className , retValue ) ; jmeComponents . add ( compList ) ; stopSequence [ _seq ] . addElement ( compList ) ; } catch ( ClassNotFoundException e ) { if ( reportError == true ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , CLASS_NAME + ".loadClass" , "3" , this ) ; SibTr . error ( tc , "CLASS_LOAD_FAILURE_SIAS0013" , className ) ; SibTr . exception ( tc , e ) ; } } catch ( InstantiationException e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , CLASS_NAME + ".loadClass" , "1" , this ) ; if ( reportError == true ) { SibTr . error ( tc , "CLASS_LOAD_FAILURE_SIAS0013" , className ) ; SibTr . exception ( tc , e ) ; } } catch ( Throwable e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , CLASS_NAME + ".loadClass" , "2" , this ) ; if ( reportError == true ) { SibTr . error ( tc , "CLASS_LOAD_FAILURE_SIAS0013" , className ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { if ( retValue == null ) SibTr . debug ( tc , "loadClass: failed" ) ; else SibTr . debug ( tc , "loadClass: OK" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , retValue ) ; } return retValue ; }
|
Load the named class and add it to the list of engine components .
|
35,441
|
public void addMember ( JSConsumerKey key ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addMember" , key ) ; super . addMember ( key ) ; synchronized ( criteriaLock ) { if ( allCriterias != null ) { SelectionCriteria [ ] newCriterias = new SelectionCriteria [ allCriterias . length + 1 ] ; System . arraycopy ( allCriterias , 0 , newCriterias , 0 , allCriterias . length ) ; allCriterias = newCriterias ; } else { allCriterias = new SelectionCriteria [ 1 ] ; } allCriterias [ allCriterias . length - 1 ] = ( ( RemoteQPConsumerKey ) key ) . getSelectionCriteria ( ) [ 0 ] ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addMember" ) ; }
|
overriding superclass method
|
35,442
|
public static void setCustomPropertyVariables ( ) { UPGRADE_READ_TIMEOUT = Integer . valueOf ( customProps . getProperty ( "upgradereadtimeout" , Integer . toString ( TCPReadRequestContext . NO_TIMEOUT ) ) ) . intValue ( ) ; UPGRADE_WRITE_TIMEOUT = Integer . valueOf ( customProps . getProperty ( "upgradewritetimeout" , Integer . toString ( TCPReadRequestContext . NO_TIMEOUT ) ) ) . intValue ( ) ; }
|
The timeout to use when the request has been upgraded and a write is happening
|
35,443
|
public void registerInvalidations ( String cacheName , Iterator invalidations ) { InvalidationTableList invalidationTableList = getInvalidationTableList ( cacheName ) ; if ( invalidationTableList != null ) { try { invalidationTableList . readWriteLock . writeLock ( ) . lock ( ) ; while ( invalidations . hasNext ( ) ) { try { Object invalidation = invalidations . next ( ) ; if ( invalidation instanceof InvalidateByIdEvent ) { InvalidateByIdEvent idEvent = ( InvalidateByIdEvent ) invalidation ; Object id = idEvent . getId ( ) ; InvalidateByIdEvent oldIdEvent = ( InvalidateByIdEvent ) invalidationTableList . presentIdSet . get ( id ) ; long timeStamp = idEvent . getTimeStamp ( ) ; if ( ( oldIdEvent != null ) && ( oldIdEvent . getTimeStamp ( ) >= timeStamp ) ) { continue ; } invalidationTableList . presentIdSet . put ( id , idEvent ) ; continue ; } InvalidateByTemplateEvent templateEvent = ( InvalidateByTemplateEvent ) invalidation ; String template = templateEvent . getTemplate ( ) ; InvalidateByTemplateEvent oldTemplateEvent = ( InvalidateByTemplateEvent ) invalidationTableList . presentTemplateSet . get ( template ) ; long timeStamp = templateEvent . getTimeStamp ( ) ; if ( ( oldTemplateEvent != null ) && ( oldTemplateEvent . getTimeStamp ( ) >= timeStamp ) ) { continue ; } invalidationTableList . presentTemplateSet . put ( template , templateEvent ) ; } catch ( Exception ex ) { com . ibm . ws . ffdc . FFDCFilter . processException ( ex , "com.ibm.ws.cache.InvalidationAuditDaemon.registerInvalidations" , "126" , this ) ; } } } finally { invalidationTableList . readWriteLock . writeLock ( ) . unlock ( ) ; } } }
|
This adds id and template invalidations .
|
35,444
|
public CacheEntry filterEntry ( String cacheName , CacheEntry cacheEntry ) { InvalidationTableList invalidationTableList = getInvalidationTableList ( cacheName ) ; try { invalidationTableList . readWriteLock . readLock ( ) . lock ( ) ; return internalFilterEntry ( cacheName , invalidationTableList , cacheEntry ) ; } finally { invalidationTableList . readWriteLock . readLock ( ) . unlock ( ) ; } }
|
This ensures the specified CacheEntrys have not been invalidated .
|
35,445
|
public ArrayList filterEntryList ( String cacheName , ArrayList incomingList ) { InvalidationTableList invalidationTableList = getInvalidationTableList ( cacheName ) ; try { invalidationTableList . readWriteLock . readLock ( ) . lock ( ) ; Iterator it = incomingList . iterator ( ) ; while ( it . hasNext ( ) ) { Object obj = it . next ( ) ; if ( obj instanceof CacheEntry ) { CacheEntry cacheEntry = ( CacheEntry ) obj ; if ( internalFilterEntry ( cacheName , invalidationTableList , cacheEntry ) == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "filterEntryList(): Filtered OUT cacheName=" + cacheName + " id=" + cacheEntry . id ) ; } it . remove ( ) ; } } } return incomingList ; } finally { invalidationTableList . readWriteLock . readLock ( ) . unlock ( ) ; } }
|
This ensures all incoming CacheEntrys have not been invalidated .
|
35,446
|
private final CacheEntry internalFilterEntry ( String cacheName , InvalidationTableList invalidationTableList , CacheEntry cacheEntry ) { InvalidateByIdEvent idEvent = null ; if ( cacheEntry == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "internalFilterEntry(): Filtered cacheName=" + cacheName + " CE == NULL" ) ; } return null ; } else if ( cacheEntry . id == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "internalFilterEntry(): Filtered cacheName=" + cacheName + " id == NULL" ) ; } return null ; } long timeStamp = cacheEntry . getTimeStamp ( ) ; idEvent = ( InvalidateByIdEvent ) invalidationTableList . presentIdSet . get ( cacheEntry . id ) ; if ( ( idEvent != null ) && ( idEvent . getTimeStamp ( ) > timeStamp ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "internalFilterEntry(): Filtered Found a more recent InvalidateByIdEvent for the cacheEntry in presentIdSet. cacheName=" + cacheName + " id=" + cacheEntry . id ) ; } return null ; } if ( collision ( invalidationTableList . presentTemplateSet , cacheEntry . getTemplates ( ) , timeStamp ) || collision ( invalidationTableList . presentIdSet , cacheEntry . getDataIds ( ) , timeStamp ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "internalFilterEntry(): Filtered due to preexisting invalidations due to dependencies and templates in present template and IdSet. cacheName=" + cacheName + " id=" + cacheEntry . id ) ; } return null ; } if ( timeStamp > lastTimeCleared ) { return cacheEntry ; } idEvent = ( InvalidateByIdEvent ) invalidationTableList . pastIdSet . get ( cacheEntry . id ) ; if ( ( idEvent != null ) && ( idEvent . getTimeStamp ( ) > timeStamp ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "internalFilterEntry(): Filtered Found a more recent InvalidateByIdEvent for the cacheEntry in pastIdSet. cacheName=" + cacheName + " id=" + cacheEntry . id ) ; } return null ; } if ( collision ( invalidationTableList . pastTemplateSet , cacheEntry . getTemplates ( ) , timeStamp ) || collision ( invalidationTableList . pastIdSet , cacheEntry . getDataIds ( ) , timeStamp ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "internalFilterEntry(): Filtered due to preexisting invalidations due to dependencies and templates in past template and IdSet. cacheName=" + cacheName + " id=" + cacheEntry . id ) ; } return null ; } return cacheEntry ; }
|
This is a helper method that filters a single CacheEntry . It is called by the filterEntry and filterEntryList methods .
|
35,447
|
public ExternalInvalidation filterExternalCacheFragment ( String cacheName , ExternalInvalidation externalCacheFragment ) { InvalidationTableList invalidationTableList = getInvalidationTableList ( cacheName ) ; try { invalidationTableList . readWriteLock . readLock ( ) . lock ( ) ; return internalFilterExternalCacheFragment ( cacheName , invalidationTableList , externalCacheFragment ) ; } finally { invalidationTableList . readWriteLock . readLock ( ) . unlock ( ) ; } }
|
This ensures that the specified ExternalCacheFragment has not been invalidated .
|
35,448
|
public ArrayList filterExternalCacheFragmentList ( String cacheName , ArrayList incomingList ) { InvalidationTableList invalidationTableList = getInvalidationTableList ( cacheName ) ; try { invalidationTableList . readWriteLock . readLock ( ) . lock ( ) ; Iterator it = incomingList . iterator ( ) ; while ( it . hasNext ( ) ) { ExternalInvalidation externalCacheFragment = ( ExternalInvalidation ) it . next ( ) ; if ( null == internalFilterExternalCacheFragment ( cacheName , invalidationTableList , externalCacheFragment ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "filterExternalCacheFragmentList(): Filtered OUT cacheName=" + cacheName + " uri=" + externalCacheFragment . getUri ( ) ) ; } it . remove ( ) ; } } return incomingList ; } finally { invalidationTableList . readWriteLock . readLock ( ) . unlock ( ) ; } }
|
This ensures all incoming ExternalCacheFragments have not been invalidated .
|
35,449
|
private final ExternalInvalidation internalFilterExternalCacheFragment ( String cacheName , InvalidationTableList invalidationTableList , ExternalInvalidation externalCacheFragment ) { if ( externalCacheFragment == null ) { return null ; } long timeStamp = externalCacheFragment . getTimeStamp ( ) ; if ( collision ( invalidationTableList . presentTemplateSet , externalCacheFragment . getInvalidationIds ( ) , timeStamp ) || collision ( invalidationTableList . presentIdSet , externalCacheFragment . getTemplates ( ) , timeStamp ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "internalFilterExternalCacheFragment(): Filtered due to preexisting invalidations due to dependencies and templates in present template and IdSet. cacheName=" + cacheName + " url=" + externalCacheFragment . getUri ( ) ) ; } return null ; } if ( timeStamp > lastTimeCleared ) { return externalCacheFragment ; } if ( collision ( invalidationTableList . pastTemplateSet , externalCacheFragment . getInvalidationIds ( ) , timeStamp ) || collision ( invalidationTableList . pastIdSet , externalCacheFragment . getTemplates ( ) , timeStamp ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "internalFilterExternalCacheFragment(): Filtered due to preexisting invalidations due to dependencies and templates in past template and IdSet. cacheName=" + cacheName + " url=" + externalCacheFragment . getUri ( ) ) ; } return null ; } return externalCacheFragment ; }
|
This is a helper method that filters a single ExternalCacheFragment . It is called by the filterExternalCacheFragment and filterExternalCacheFragmentList methods .
|
35,450
|
private final boolean collision ( Map < Object , InvalidationEvent > hashtable , Enumeration enumeration , long timeStamp ) { while ( enumeration . hasMoreElements ( ) ) { Object key = enumeration . nextElement ( ) ; InvalidationEvent invalidationEvent = ( InvalidationEvent ) hashtable . get ( key ) ; if ( ( invalidationEvent != null ) && ( invalidationEvent . getTimeStamp ( ) > timeStamp ) ) { return true ; } } return false ; }
|
This is a helper method that checks for a collision .
|
35,451
|
private InvalidationTableList getInvalidationTableList ( String cacheName ) { InvalidationTableList invalidationTableList = cacheinvalidationTables . get ( cacheName ) ; if ( invalidationTableList == null ) { synchronized ( this ) { invalidationTableList = new InvalidationTableList ( ) ; cacheinvalidationTables . put ( cacheName , invalidationTableList ) ; } } return invalidationTableList ; }
|
Retrieve the InvalidationTableList by the specified cacheName .
|
35,452
|
public static File getBootstrapJar ( ) { if ( launchHome == null ) { if ( launchURL == null ) { launchURL = getLocationFromClass ( KernelUtils . class ) ; } launchHome = FileUtils . getFile ( launchURL ) ; } return launchHome ; }
|
The location of the launch jar is only obtained once .
|
35,453
|
public static File getBootstrapLibDir ( ) { if ( libDir . get ( ) == null ) { libDir = StaticValue . mutateStaticValue ( libDir , new Utils . FileInitializer ( getBootstrapJar ( ) . getParentFile ( ) ) ) ; } return libDir . get ( ) ; }
|
The lib dir is the parent of the bootstrap jar
|
35,454
|
public static Properties getProperties ( final InputStream is ) throws IOException { Properties p = new Properties ( ) ; try { if ( is != null ) { p . load ( is ) ; for ( Entry < Object , Object > entry : p . entrySet ( ) ) { String s = ( ( String ) entry . getValue ( ) ) . trim ( ) ; if ( s . length ( ) > 1 && s . startsWith ( "\"" ) && s . endsWith ( "\"" ) ) { entry . setValue ( s . substring ( 1 , s . length ( ) - 1 ) ) ; } } } } finally { Utils . tryToClose ( is ) ; } return p ; }
|
Read properties from input stream . Will close the input stream before returning .
|
35,455
|
private static String getClassFromLine ( String line ) { line = line . trim ( ) ; if ( line . length ( ) == 0 || line . startsWith ( "#" ) ) return null ; String [ ] className = line . split ( "[\\s#]" ) ; if ( className . length >= 1 ) return className [ 0 ] ; return null ; }
|
Read a service class from the given line . Must ignore whitespace and skip comment lines or end of line comments .
|
35,456
|
public final void checkSpillLimits ( ) { long currentTotal ; long currentSize ; synchronized ( this ) { currentTotal = _countTotal ; currentSize = _countTotalBytes ; } if ( ! _spilling ) { _movingTotal = _movingTotal + currentTotal ; long movingAverage = _movingTotal / MOVING_AVERAGE_LENGTH ; _movingTotal = _movingTotal - movingAverage ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Stream is NOT SPILLING" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Current size :" + currentSize ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Current total :" + currentTotal ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Moving average:" + movingAverage ) ; if ( movingAverage >= _movingAverageHighLimit || currentSize >= _totalSizeHighLimit ) { _spilling = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Stream has STARTED SPILLING" ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Stream is SPILLING" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Current size :" + currentSize ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Current total :" + currentTotal ) ; if ( currentTotal <= _movingAverageLowLimit && currentSize <= _totalSizeLowLimit ) { _spilling = false ; _movingTotal = _movingAverageLowLimit * ( MOVING_AVERAGE_LENGTH - 1 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Stream has STOPPED SPILLING" ) ; } } }
|
Instead of just triggering spilling when we have a certain number of Items on a stream we now have the ability to trigger spilling if the total size of the Items on a stream goes over a pre - defined limit . This should allow us to control the memory usage of a stream in a more intuitive fashion .
|
35,457
|
public final void updateTotal ( int oldSizeInBytes , int newSizeInBytes ) throws SevereMessageStoreException { boolean doCallback = false ; synchronized ( this ) { boolean wasBelowHighLimit = ( _countTotalBytes < _watermarkBytesHigh ) ; boolean wasAboveLowLimit = ( _countTotalBytes >= _watermarkBytesLow ) ; _countTotalBytes = _countTotalBytes + ( newSizeInBytes - oldSizeInBytes ) ; if ( ( wasBelowHighLimit && _countTotalBytes >= _watermarkBytesHigh ) || ( wasAboveLowLimit && _countTotalBytes < _watermarkBytesLow ) ) { doCallback = true ; } } if ( doCallback ) { _owningStreamLink . eventWatermarkBreached ( ) ; } }
|
once we have the Item available to determine it from .
|
35,458
|
public static void addUnspecifiedAttributes ( FeatureDescriptor descriptor , Tag tag , String [ ] standardAttributesSorted , FaceletContext ctx ) { for ( TagAttribute attribute : tag . getAttributes ( ) . getAll ( ) ) { final String name = attribute . getLocalName ( ) ; if ( Arrays . binarySearch ( standardAttributesSorted , name ) < 0 ) { descriptor . setValue ( name , attribute . getValueExpression ( ctx , Object . class ) ) ; } } }
|
Adds all attributes from the given Tag which are NOT listed in standardAttributesSorted as a ValueExpression to the given BeanDescriptor . NOTE that standardAttributesSorted has to be alphabetically sorted in order to use binary search .
|
35,459
|
public static boolean containsUnspecifiedAttributes ( Tag tag , String [ ] standardAttributesSorted ) { for ( TagAttribute attribute : tag . getAttributes ( ) . getAll ( ) ) { final String name = attribute . getLocalName ( ) ; if ( Arrays . binarySearch ( standardAttributesSorted , name ) < 0 ) { return true ; } } return false ; }
|
Returns true if the given Tag contains attributes that are not specified in standardAttributesSorted . NOTE that standardAttributesSorted has to be alphabetically sorted in order to use binary search .
|
35,460
|
public static void addDevelopmentAttributes ( FeatureDescriptor descriptor , FaceletContext ctx , TagAttribute displayName , TagAttribute shortDescription , TagAttribute expert , TagAttribute hidden , TagAttribute preferred ) { if ( displayName != null ) { descriptor . setDisplayName ( displayName . getValue ( ctx ) ) ; } if ( shortDescription != null ) { descriptor . setShortDescription ( shortDescription . getValue ( ctx ) ) ; } if ( expert != null ) { descriptor . setExpert ( expert . getBoolean ( ctx ) ) ; } if ( hidden != null ) { descriptor . setHidden ( hidden . getBoolean ( ctx ) ) ; } if ( preferred != null ) { descriptor . setPreferred ( preferred . getBoolean ( ctx ) ) ; } }
|
Applies the displayName shortDescription expert hidden and preferred attributes to the BeanDescriptor .
|
35,461
|
public static void addDevelopmentAttributesLiteral ( FeatureDescriptor descriptor , TagAttribute displayName , TagAttribute shortDescription , TagAttribute expert , TagAttribute hidden , TagAttribute preferred ) { if ( displayName != null ) { descriptor . setDisplayName ( displayName . getValue ( ) ) ; } if ( shortDescription != null ) { descriptor . setShortDescription ( shortDescription . getValue ( ) ) ; } if ( expert != null ) { descriptor . setExpert ( Boolean . valueOf ( expert . getValue ( ) ) ) ; } if ( hidden != null ) { descriptor . setHidden ( Boolean . valueOf ( hidden . getValue ( ) ) ) ; } if ( preferred != null ) { descriptor . setPreferred ( Boolean . valueOf ( preferred . getValue ( ) ) ) ; } }
|
Applies the displayName shortDescription expert hidden and preferred attributes to the BeanDescriptor if they are all literal values . Thus no FaceletContext is necessary .
|
35,462
|
public static boolean areAttributesLiteral ( TagAttribute ... attributes ) { for ( TagAttribute attribute : attributes ) { if ( attribute != null && ! attribute . isLiteral ( ) ) { return false ; } } return true ; }
|
Returns true if all specified attributes are either null or literal .
|
35,463
|
protected static FacesServletMapping calculateFacesServletMapping ( String servletPath , String pathInfo ) { if ( pathInfo != null ) { return FacesServletMapping . createPrefixMapping ( servletPath ) ; } else { int slashPos = servletPath . lastIndexOf ( '/' ) ; int extensionPos = servletPath . lastIndexOf ( '.' ) ; if ( extensionPos > - 1 && extensionPos > slashPos ) { String extension = servletPath . substring ( extensionPos ) ; return FacesServletMapping . createExtensionMapping ( extension ) ; } else { return FacesServletMapping . createPrefixMapping ( servletPath ) ; } } }
|
Determines the mapping of the FacesServlet in the web . xml configuration file . However there is no need to actually parse this configuration file as runtime information is sufficient .
|
35,464
|
private boolean isCDIEnabled ( Collection < WebSphereBeanDeploymentArchive > bdas ) { boolean anyHasBeans = false ; for ( WebSphereBeanDeploymentArchive bda : bdas ) { boolean hasBeans = false ; if ( bda . getType ( ) != ArchiveType . RUNTIME_EXTENSION ) { hasBeans = isCDIEnabled ( bda ) ; } anyHasBeans = anyHasBeans || hasBeans ; if ( anyHasBeans ) { break ; } } return anyHasBeans ; }
|
Do any of the specified BDAs or any of BDAs accessible by them have any beans
|
35,465
|
private boolean isCDIEnabled ( WebSphereBeanDeploymentArchive bda ) { Boolean hasBeans = cdiStatusMap . get ( bda . getId ( ) ) ; if ( hasBeans == null ) { hasBeans = bda . hasBeans ( ) || bda . isExtension ( ) ; cdiStatusMap . put ( bda . getId ( ) , hasBeans ) ; hasBeans = hasBeans || isCDIEnabled ( bda . getWebSphereBeanDeploymentArchives ( ) ) ; cdiStatusMap . put ( bda . getId ( ) , hasBeans ) ; } return hasBeans ; }
|
Does the specified BDA or any of BDAs accessible by it have any beans or it is an extension which could add beans
|
35,466
|
public boolean isCDIEnabled ( String bdaId ) { boolean hasBeans = false ; if ( isCDIEnabled ( ) ) { Boolean hasBeansBoolean = cdiStatusMap . get ( bdaId ) ; if ( hasBeansBoolean == null ) { WebSphereBeanDeploymentArchive bda = deploymentDBAs . get ( bdaId ) ; if ( bda == null ) { hasBeans = false ; } else { hasBeans = isCDIEnabled ( bda ) ; } } else { hasBeans = hasBeansBoolean ; } } return hasBeans ; }
|
Does the specified BDA or any of BDAs accessible by it have any beans or an extension which might add beans .
|
35,467
|
private BeanDeploymentArchive createBDAOntheFly ( Class < ? > beanClass ) throws CDIException { BeanDeploymentArchive bdaToReturn = findCandidateBDAtoAddThisClass ( beanClass ) ; if ( bdaToReturn != null ) { return bdaToReturn ; } else { return createNewBdaAndMakeWiring ( beanClass ) ; } }
|
Create a bda and wire it in the deployment graph
|
35,468
|
private BeanDeploymentArchive createNewBdaAndMakeWiring ( Class < ? > beanClass ) { try { OnDemandArchive onDemandArchive = new OnDemandArchive ( cdiRuntime , application , beanClass ) ; WebSphereBeanDeploymentArchive newBda = BDAFactory . createBDA ( this , onDemandArchive , cdiRuntime ) ; ClassLoader beanClassCL = onDemandArchive . getClassLoader ( ) ; for ( WebSphereBeanDeploymentArchive wbda : getWebSphereBeanDeploymentArchives ( ) ) { ClassLoader thisBDACL = wbda . getClassLoader ( ) ; if ( wbda . getType ( ) == ArchiveType . RUNTIME_EXTENSION ) { newBda . addBeanDeploymentArchive ( wbda ) ; } else { makeWiring ( newBda , wbda , thisBDACL , beanClassCL ) ; } if ( ( wbda . getType ( ) == ArchiveType . RUNTIME_EXTENSION ) && wbda . extensionCanSeeApplicationBDAs ( ) ) { wbda . addBeanDeploymentArchive ( newBda ) ; } else { makeWiring ( wbda , newBda , beanClassCL , thisBDACL ) ; } } addBeanDeploymentArchive ( newBda ) ; return newBda ; } catch ( CDIException e ) { throw new IllegalStateException ( e ) ; } }
|
Create a new bda and put the beanClass to the bda and then wire this bda in the deployment according to the classloading hierarchy
|
35,469
|
private BeanDeploymentArchive findCandidateBDAtoAddThisClass ( Class < ? > beanClass ) throws CDIException { for ( WebSphereBeanDeploymentArchive wbda : getWebSphereBeanDeploymentArchives ( ) ) { if ( wbda . getClassLoader ( ) == beanClass . getClassLoader ( ) ) { wbda . addToBeanClazzes ( beanClass ) ; return wbda ; } if ( ( beanClass . getClassLoader ( ) == null ) && ( wbda . getId ( ) . endsWith ( CDIUtils . BDA_FOR_CLASSES_LOADED_BY_ROOT_CLASSLOADER ) ) ) { wbda . addToBeanClazzes ( beanClass ) ; return wbda ; } } return null ; }
|
Find the bda with the same classloader as the beanClass and then add the beanclasses to it
|
35,470
|
private void makeWiring ( WebSphereBeanDeploymentArchive wireFromBda , WebSphereBeanDeploymentArchive wireToBda , ClassLoader wireToBdaCL , ClassLoader wireFromBdaCL ) { while ( wireFromBdaCL != null ) { if ( wireFromBdaCL == wireToBdaCL ) { wireFromBda . addBeanDeploymentArchive ( wireToBda ) ; break ; } else { wireFromBdaCL = wireFromBdaCL . getParent ( ) ; } } if ( wireFromBdaCL == wireToBdaCL ) { wireFromBda . addBeanDeploymentArchive ( wireToBda ) ; } }
|
Make a wiring from the wireFromBda to the wireToBda if the wireFromBda s classloader is the descendant of the wireToBda s classloader
|
35,471
|
public void addBeanDeploymentArchive ( WebSphereBeanDeploymentArchive bda ) throws CDIException { deploymentDBAs . put ( bda . getId ( ) , bda ) ; extensionClassLoaders . add ( bda . getClassLoader ( ) ) ; ArchiveType type = bda . getType ( ) ; if ( type != ArchiveType . SHARED_LIB && type != ArchiveType . RUNTIME_EXTENSION ) { applicationBDAs . add ( bda ) ; } }
|
Add a BeanDeploymentArchive to this deployment
|
35,472
|
public void addBeanDeploymentArchives ( Set < WebSphereBeanDeploymentArchive > bdas ) throws CDIException { for ( WebSphereBeanDeploymentArchive bda : bdas ) { addBeanDeploymentArchive ( bda ) ; } }
|
Add a Set of BDAs to the deployment
|
35,473
|
public void scan ( ) throws CDIException { Collection < WebSphereBeanDeploymentArchive > allBDAs = new ArrayList < WebSphereBeanDeploymentArchive > ( deploymentDBAs . values ( ) ) ; for ( WebSphereBeanDeploymentArchive bda : allBDAs ) { bda . scanForBeanDefiningAnnotations ( true ) ; } for ( WebSphereBeanDeploymentArchive bda : allBDAs ) { if ( ! bda . hasBeenScanned ( ) ) { bda . scan ( ) ; } } }
|
Scan all the BDAs in the deployment to see if there are any bean classes .
|
35,474
|
public void initializeInjectionServices ( ) throws CDIException { Set < ReferenceContext > cdiReferenceContexts = new HashSet < ReferenceContext > ( ) ; for ( WebSphereBeanDeploymentArchive bda : getApplicationBDAs ( ) ) { if ( bda . getType ( ) != ArchiveType . MANIFEST_CLASSPATH && bda . getType ( ) != ArchiveType . WEB_INF_LIB ) { ReferenceContext referenceContext = bda . initializeInjectionServices ( ) ; cdiReferenceContexts . add ( referenceContext ) ; } } for ( ReferenceContext referenceContext : cdiReferenceContexts ) { try { referenceContext . process ( ) ; } catch ( InjectionException e ) { throw new CDIException ( e ) ; } } }
|
Initialize the Resource Injection Service with each BDA s bean classes .
|
35,475
|
public void shutdown ( ) { if ( this . bootstrap != null ) { AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { public Void run ( ) { bootstrap . shutdown ( ) ; return null ; } } ) ; this . bootstrap = null ; this . deploymentDBAs . clear ( ) ; this . applicationBDAs . clear ( ) ; this . classloader = null ; this . extensionClassLoaders . clear ( ) ; this . cdiEnabled = false ; this . cdiStatusMap . clear ( ) ; this . application = null ; this . classBDAMap . clear ( ) ; } }
|
Shutdown and clean up the whole deployment . The deployment will not be usable after this call has been made .
|
35,476
|
boolean isConfigValid ( ConvergedClientConfig config ) { boolean valid = true ; String clientId = config . getClientId ( ) ; String clientSecret = config . getClientSecret ( ) ; String authorizationEndpoint = config . getAuthorizationEndpointUrl ( ) ; String jwksUri = config . getJwkEndpointUrl ( ) ; if ( clientId == null || clientId . length ( ) == 0 ) { Tr . error ( tc , "INVALID_CONFIG_PARAM" , new Object [ ] { OidcLoginConfigImpl . KEY_clientId , clientId } ) ; valid = false ; } if ( clientSecret == null || clientSecret . length ( ) == 0 ) { Tr . error ( tc , "INVALID_CONFIG_PARAM" , new Object [ ] { OidcLoginConfigImpl . KEY_clientSecret , "" } ) ; valid = false ; } if ( authorizationEndpoint == null || authorizationEndpoint . length ( ) == 0 || ( ! authorizationEndpoint . toLowerCase ( ) . startsWith ( "http" ) ) ) { Tr . error ( tc , "INVALID_CONFIG_PARAM" , new Object [ ] { OidcLoginConfigImpl . KEY_authorizationEndpoint , authorizationEndpoint } ) ; valid = false ; } return valid ; }
|
Check for some things that will always fail and emit message about bad config . Do here so 1 ) classic oidc messages don t change and 2 ) put error message closer in log to failure .
|
35,477
|
protected void cleanOutBifurcatedMessages ( BifurcatedConsumerSessionImpl owner , boolean bumpRedeliveryOnClose ) throws SIResourceException , SISessionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "cleanOutBifurcatedMessages" , new Object [ ] { new Integer ( hashCode ( ) ) , this } ) ; int unlockedMessages = 0 ; synchronized ( this ) { if ( firstMsg != null ) { LMEMessage message = firstMsg ; LMEMessage unlockMsg = null ; while ( message != null ) { unlockMsg = message ; message = message . next ; if ( unlockMsg . owner == owner ) { if ( unlockMsg . isStored ) { try { unlockMessage ( unlockMsg . message , bumpRedeliveryOnClose ) ; } catch ( SIMPMessageNotLockedException e ) { SibTr . exception ( tc , e ) ; } } removeMessage ( unlockMsg ) ; unlockedMessages ++ ; } } } } if ( unlockedMessages != 0 ) localConsumerPoint . removeActiveMessages ( unlockedMessages ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "cleanOutBifurcatedMessages" , this ) ; }
|
When a bifurcated consumer is closed all locked messages owned by that consumer must be unlocked
|
35,478
|
protected int getNumberOfLockedMessages ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getNumberOfLockedMessages" ) ; int count = 0 ; synchronized ( this ) { LMEMessage message ; message = firstMsg ; while ( message != null ) { count ++ ; message = message . next ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getNumberOfLockedMessages" , new Integer ( count ) ) ; return count ; }
|
Return the number of locked messages that are part of this locked message enumeration . The count will start from thr firstMsg unlike th getRemainingMessageCount which starts from the currentMsg .
|
35,479
|
protected void removeMessage ( LMEMessage message ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeMessage" , new Object [ ] { new Integer ( hashCode ( ) ) , message , this } ) ; if ( message == callbackEntryMsg ) callbackEntryMsg = message . previous ; if ( message == currentMsg ) currentMsg = message . previous ; if ( message == nextMsgToExpire ) { do { nextMsgToExpire = nextMsgToExpire . next ; } while ( ( nextMsgToExpire != null ) && ( nextMsgToExpire . expiryTime == 0 ) ) ; } if ( message == nextMsgReferenceToExpire ) { do { nextMsgReferenceToExpire = nextMsgReferenceToExpire . next ; } while ( ( nextMsgReferenceToExpire != null ) && ( nextMsgReferenceToExpire . expiryTime == 0 ) ) ; } if ( message . previous != null ) message . previous . next = message . next ; else firstMsg = message . next ; if ( message . next != null ) message . next . previous = message . previous ; else lastMsg = message . previous ; if ( pooledCount < poolSize ) { message . message = null ; message . next = pooledMsg ; message . previous = null ; message . owner = null ; message . jsMessage = null ; message . expiryTime = 0 ; message . expiryMsgReferenceTime = 0 ; pooledMsg = message ; pooledCount ++ ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeMessage" , this ) ; }
|
Remove a message object from the list
|
35,480
|
protected void resetCallbackCursor ( ) throws SIResourceException , SISessionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "resetCallbackCursor" , new Integer ( hashCode ( ) ) ) ; synchronized ( this ) { unlockAllUnread ( ) ; callbackEntryMsg = lastMsg ; currentMsg = lastMsg ; messageAvailable = false ; endReached = false ; validState = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "resetCallbackCursor" , this ) ; }
|
This is called when a consumeMessages call has completed it returns the LME to a consistent state ready for the next consumeMessages .
|
35,481
|
final JsMessage setPropertiesInMessage ( LMEMessage theMessage ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setPropertiesInMessage" , theMessage ) ; boolean copyMade = false ; JsMessageWrapper jsMessageWrapper = ( JsMessageWrapper ) theMessage . message ; JsMessage jsMsg = jsMessageWrapper . getMessage ( ) ; try { if ( jsMessageWrapper . guessRedeliveredCount ( ) != 0 ) { if ( isPubsub ) { jsMsg = jsMsg . getReceived ( ) ; copyMade = true ; } jsMsg . setRedeliveredCount ( jsMessageWrapper . guessRedeliveredCount ( ) ) ; } long waitTime = jsMessageWrapper . updateStatisticsMessageWaitTime ( ) ; if ( setWaitTime ) { boolean waitTimeIsSignificant = waitTime > messageProcessor . getCustomProperties ( ) . get_message_wait_time_granularity ( ) ; if ( waitTimeIsSignificant ) { if ( isPubsub && ! copyMade ) { jsMsg = jsMsg . getReceived ( ) ; copyMade = true ; } jsMsg . setMessageWaitTime ( waitTime ) ; } } if ( ! copyMade && ( ( theMessage . isStored && copyMsg ) || isPubsub ) ) jsMsg = jsMsg . getReceived ( ) ; } catch ( MessageCopyFailedException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration.setPropertiesInMessage" , "1:2086:1.154.3.1" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration" , "1:2093:1.154.3.1" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setPropertiesInMessage" , e ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration" , "1:2104:1.154.3.1" , e } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setPropertiesInMessage" , jsMsg ) ; return jsMsg ; }
|
Sets the redelivered count and the message wait time if required .
|
35,482
|
protected void unlockAll ( boolean closingSession ) throws SIResourceException , SIMPMessageNotLockedException , SISessionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "unlockAll" , new Object [ ] { new Integer ( hashCode ( ) ) , this } ) ; int unlockedMessages = 0 ; SIMPMessageNotLockedException notLockedException = null ; int notLockedExceptionMessageIndex = 0 ; synchronized ( this ) { messageAvailable = false ; if ( firstMsg != null ) { LMEMessage pointerMsg = firstMsg ; LMEMessage removedMsg = null ; SIMessageHandle [ ] messageHandles = new SIMessageHandle [ getNumberOfLockedMessages ( ) ] ; boolean more = true ; while ( more ) { if ( pointerMsg == lastMsg ) more = false ; if ( pointerMsg != currentUnlockedMessage ) { if ( pointerMsg . isStored ) { try { unlockMessage ( pointerMsg . message , true ) ; } catch ( SIMPMessageNotLockedException e ) { SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration" , "1:2229:1.154.3.1" , e } ) ; messageHandles [ notLockedExceptionMessageIndex ] = pointerMsg . getJsMessage ( ) . getMessageHandle ( ) ; notLockedExceptionMessageIndex ++ ; if ( notLockedException == null ) notLockedException = e ; } catch ( SISessionDroppedException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration.unlockAll" , "1:2243:1.154.3.1" , this ) ; if ( ! closingSession ) { handleSessionDroppedException ( e ) ; } SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration.unlockAll" , "1:2255:1.154.3.1" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockAll" , e ) ; throw e ; } } unlockedMessages ++ ; } removedMsg = pointerMsg ; pointerMsg = pointerMsg . next ; removeMessage ( removedMsg ) ; } currentUnlockedMessage = null ; } } if ( unlockedMessages != 0 ) localConsumerPoint . removeActiveMessages ( unlockedMessages ) ; if ( notLockedException != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockAll" , this ) ; throw notLockedException ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockAll" , this ) ; }
|
Unlock all the messages in the list
|
35,483
|
private void unlockAllUnread ( ) throws SIResourceException , SISessionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "unlockAllUnread" , new Object [ ] { new Integer ( hashCode ( ) ) , this } ) ; int unlockedMessages = 0 ; synchronized ( this ) { messageAvailable = false ; if ( firstMsg != null && ! endReached ) { LMEMessage pointerMsg = null ; if ( currentMsg == null ) pointerMsg = firstMsg ; else pointerMsg = currentMsg . next ; LMEMessage removedMsg = null ; boolean more = true ; if ( pointerMsg != null ) { while ( more ) { if ( pointerMsg == lastMsg ) more = false ; if ( pointerMsg != currentUnlockedMessage ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Unlocking Message " + pointerMsg ) ; if ( pointerMsg . isStored ) { try { unlockMessage ( pointerMsg . message , false ) ; } catch ( SIMPMessageNotLockedException e ) { SibTr . exception ( tc , e ) ; } } unlockedMessages ++ ; } removedMsg = pointerMsg ; pointerMsg = pointerMsg . next ; removeMessage ( removedMsg ) ; } } } } if ( unlockedMessages != 0 ) localConsumerPoint . removeActiveMessages ( unlockedMessages ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockAllUnread" , this ) ; }
|
Method to unlock all messages which haven t been read
|
35,484
|
public boolean containsValue ( Token value , Transaction transaction ) throws ObjectManagerException { try { for ( Iterator iterator = entrySet ( ) . iterator ( ) ; ; ) { Entry entry = ( Entry ) iterator . next ( transaction ) ; Token entryValue = entry . getValue ( ) ; if ( value == entryValue ) { return true ; } } } catch ( java . util . NoSuchElementException exception ) { return false ; } }
|
Determines if the Map contains the Token
|
35,485
|
public long countAllMessagesOnStream ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "countAllMessagesOnStream" ) ; long count = 0 ; _targetStream . setCursor ( 0 ) ; TickRange tr = _targetStream . getNext ( ) ; while ( tr . endstamp < RangeList . INFINITY ) { if ( tr . type == TickRange . Value ) { count ++ ; } if ( tr . type == TickRange . Requested ) { if ( ( ( AIRequestedTick ) tr . value ) . getRestoringAOValue ( ) != null ) count ++ ; } tr = _targetStream . getNext ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "countAllMessagesOnStream" , Long . valueOf ( count ) ) ; return count ; }
|
Counts the number of messages in the value state on the stream .
|
35,486
|
public final void incrementUnlockCount ( long tick ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "incrementUnlockCount" , Long . valueOf ( tick ) ) ; _targetStream . setCursor ( tick ) ; TickRange tickRange = _targetStream . getNext ( ) ; if ( tickRange . type == TickRange . Value ) { AIValueTick valueTick = ( AIValueTick ) tickRange . value ; if ( valueTick != null ) valueTick . incRMEUnlockCount ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "incrementUnlockCount" , tickRange ) ; }
|
sets the unlock count of the value tick s msg .
|
35,487
|
public void processRequestAck ( long tick , long dmeVersion ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processRequestAck" , new Object [ ] { Long . valueOf ( tick ) , Long . valueOf ( dmeVersion ) } ) ; if ( dmeVersion >= _latestDMEVersion ) { _targetStream . setCursor ( tick ) ; TickRange tickRange = _targetStream . getNext ( ) ; if ( tickRange . type == TickRange . Requested ) { AIRequestedTick airt = ( AIRequestedTick ) tickRange . value ; synchronized ( airt ) { if ( ! airt . isSlowed ( ) ) { _eagerGetTOM . removeTimeoutEntry ( airt ) ; airt . setSlowed ( true ) ; airt . setAckingDMEVersion ( dmeVersion ) ; long to = airt . getTimeout ( ) ; if ( to > 0 || to == _mp . getCustomProperties ( ) . get_infinite_timeout ( ) ) { _slowedGetTOM . addTimeoutEntry ( airt ) ; } } } } else { } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processRequestAck" ) ; }
|
A ControlRequestAck message tells the RME to slow down its get repetition timeout since we now know that the DME has received the request .
|
35,488
|
public void processResetRequestAck ( long dmeVersion , SendDispatcher sendDispatcher ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processResetRequestAck" , Long . valueOf ( dmeVersion ) ) ; if ( dmeVersion >= _latestDMEVersion ) { if ( dmeVersion > _latestDMEVersion ) _latestDMEVersion = dmeVersion ; _slowedGetTOM . applyToEachEntry ( new AddToEagerTOM ( _slowedGetTOM , dmeVersion ) ) ; sendDispatcher . sendResetRequestAckAck ( dmeVersion ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processResetRequestAck" ) ; }
|
A ControlResetRequestAck message tells the RME to start re - sending get requests with an eager timeout since the DME has crashed and recovered .
|
35,489
|
public AnycastInputHandler getAnycastInputHandler ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getAnycastInputHandler" ) ; SibTr . exit ( tc , "getAnycastInputHandler" , _parent ) ; } return _parent ; }
|
Returns the AnycastInputHandler associated with this AIStream
|
35,490
|
public void messagingEngineStarting ( final JsMessagingEngine messagingEngine ) { final String methodName = "messagingEngineStarting" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , messagingEngine ) ; } try { addMessagingEngine ( messagingEngine ) ; } catch ( final ResourceException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , "1:608:1.40" , this ) ; SibTr . error ( TRACE , "MESSAGING_ENGINE_STARTING_CWSIV0555" , new Object [ ] { exception , messagingEngine . getName ( ) , messagingEngine . getBusName ( ) , this } ) ; deactivate ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
|
Called to indicate that a messaging engine has been started . Adds it to the set of active messaging engines .
|
35,491
|
public void messagingEngineStopping ( final JsMessagingEngine messagingEngine , final int mode ) { final String methodName = "messagingEngineStopping" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { messagingEngine , mode } ) ; } closeConnection ( messagingEngine ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
|
Called to indicate that a messaging engine is stopping . Removes it from the set of active messaging engines and closes any open connection .
|
35,492
|
private SQLException classNotFound ( Object interfaceNames , Set < String > packagesSearched , String dsId , Throwable cause ) { if ( cause instanceof SQLException ) return ( SQLException ) cause ; String sharedLibId = sharedLib . id ( ) ; Collection < String > driverJARs = getClasspath ( sharedLib , false ) ; String message = sharedLibId . startsWith ( "com.ibm.ws.jdbc.jdbcDriver-" ) ? AdapterUtil . getNLSMessage ( "DSRA4001.no.suitable.driver.nested" , interfaceNames , dsId , driverJARs , packagesSearched ) : AdapterUtil . getNLSMessage ( "DSRA4000.no.suitable.driver" , interfaceNames , dsId , sharedLibId , driverJARs , packagesSearched ) ; return new SQLNonTransientException ( message , cause ) ; }
|
Returns an exception to raise when the data source class is not found .
|
35,493
|
public ConnectionPoolDataSource createConnectionPoolDataSource ( Properties props , String dataSourceID ) throws SQLException { lock . readLock ( ) . lock ( ) ; try { if ( ! isInitialized ) try { lock . readLock ( ) . unlock ( ) ; lock . writeLock ( ) . lock ( ) ; if ( ! isInitialized ) { if ( ! loadFromApp ( ) ) classloader = AdapterUtil . getClassLoaderWithPriv ( sharedLib ) ; isInitialized = true ; } } finally { lock . readLock ( ) . lock ( ) ; lock . writeLock ( ) . unlock ( ) ; } String className = ( String ) properties . get ( ConnectionPoolDataSource . class . getName ( ) ) ; if ( className == null ) { String vendorPropertiesPID = props instanceof PropertyService ? ( ( PropertyService ) props ) . getFactoryPID ( ) : PropertyService . FACTORY_PID ; className = JDBCDrivers . getConnectionPoolDataSourceClassName ( vendorPropertiesPID ) ; if ( className == null ) { if ( "com.ibm.ws.jdbc.dataSource.properties.oracle.ucp" . equals ( vendorPropertiesPID ) ) { throw new SQLNonTransientException ( AdapterUtil . getNLSMessage ( "DSRA4015.no.ucp.connection.pool.datasource" , dataSourceID , ConnectionPoolDataSource . class . getName ( ) ) ) ; } className = JDBCDrivers . getConnectionPoolDataSourceClassName ( getClasspath ( sharedLib , true ) ) ; if ( className == null ) { Set < String > packagesSearched = new LinkedHashSet < String > ( ) ; SimpleEntry < Integer , String > dsEntry = JDBCDrivers . inferDataSourceClassFromDriver ( classloader , packagesSearched , JDBCDrivers . CONNECTION_POOL_DATA_SOURCE ) ; className = dsEntry == null ? null : dsEntry . getValue ( ) ; if ( className == null ) throw classNotFound ( ConnectionPoolDataSource . class . getName ( ) , packagesSearched , dataSourceID , null ) ; } } } return create ( className , props , dataSourceID ) ; } finally { lock . readLock ( ) . unlock ( ) ; } }
|
Create a ConnectionPoolDataSource
|
35,494
|
public DataSource createDataSource ( Properties props , String dataSourceID ) throws SQLException { lock . readLock ( ) . lock ( ) ; try { if ( ! isInitialized ) try { lock . readLock ( ) . unlock ( ) ; lock . writeLock ( ) . lock ( ) ; if ( ! isInitialized ) { if ( ! loadFromApp ( ) ) classloader = AdapterUtil . getClassLoaderWithPriv ( sharedLib ) ; isInitialized = true ; } } finally { lock . readLock ( ) . lock ( ) ; lock . writeLock ( ) . unlock ( ) ; } String className = ( String ) properties . get ( DataSource . class . getName ( ) ) ; if ( className == null ) { String vendorPropertiesPID = props instanceof PropertyService ? ( ( PropertyService ) props ) . getFactoryPID ( ) : PropertyService . FACTORY_PID ; className = JDBCDrivers . getDataSourceClassName ( vendorPropertiesPID ) ; if ( className == null ) { className = JDBCDrivers . getDataSourceClassName ( getClasspath ( sharedLib , true ) ) ; if ( className == null ) { Set < String > packagesSearched = new LinkedHashSet < String > ( ) ; SimpleEntry < Integer , String > dsEntry = JDBCDrivers . inferDataSourceClassFromDriver ( classloader , packagesSearched , JDBCDrivers . DATA_SOURCE ) ; className = dsEntry == null ? null : dsEntry . getValue ( ) ; if ( className == null ) throw classNotFound ( DataSource . class . getName ( ) , packagesSearched , dataSourceID , null ) ; } } } return create ( className , props , dataSourceID ) ; } finally { lock . readLock ( ) . unlock ( ) ; } }
|
Create a DataSource
|
35,495
|
public Object getDriver ( String url , Properties props , String dataSourceID ) throws Exception { lock . readLock ( ) . lock ( ) ; try { if ( ! isInitialized ) try { lock . readLock ( ) . unlock ( ) ; lock . writeLock ( ) . lock ( ) ; if ( ! isInitialized ) { if ( ! loadFromApp ( ) ) classloader = AdapterUtil . getClassLoaderWithPriv ( sharedLib ) ; isInitialized = true ; } } finally { lock . readLock ( ) . lock ( ) ; lock . writeLock ( ) . unlock ( ) ; } final String className = ( String ) properties . get ( Driver . class . getName ( ) ) ; if ( className == null ) { String vendorPropertiesPID = props instanceof PropertyService ? ( ( PropertyService ) props ) . getFactoryPID ( ) : PropertyService . FACTORY_PID ; if ( "com.ibm.ws.jdbc.dataSource.properties.oracle.ucp" . equals ( vendorPropertiesPID ) ) { throw new SQLNonTransientException ( AdapterUtil . getNLSMessage ( "DSRA4015.no.ucp.connection.pool.datasource" , dataSourceID , Driver . class . getName ( ) ) ) ; } } Driver driver = loadDriver ( className , url , classloader , props , dataSourceID ) ; if ( driver == null ) throw classNotFound ( Driver . class . getName ( ) , Collections . singleton ( "META-INF/services/java.sql.Driver" ) , dataSourceID , null ) ; return driver ; } finally { lock . readLock ( ) . unlock ( ) ; } }
|
Load the Driver instance for the specified URL .
|
35,496
|
public static Collection < String > getClasspath ( Library sharedLib , boolean upperCaseFileNamesOnly ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getClasspath" , sharedLib ) ; Collection < String > classpath = new LinkedList < String > ( ) ; if ( sharedLib != null && sharedLib . getFiles ( ) != null ) for ( File file : sharedLib . getFiles ( ) ) classpath . add ( upperCaseFileNamesOnly ? file . getName ( ) . toUpperCase ( ) : file . getAbsolutePath ( ) ) ; if ( sharedLib != null && sharedLib . getFilesets ( ) != null ) for ( Fileset fileset : sharedLib . getFilesets ( ) ) for ( File file : fileset . getFileset ( ) ) classpath . add ( upperCaseFileNamesOnly ? file . getName ( ) . toUpperCase ( ) : file . getAbsolutePath ( ) ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getClasspath" , classpath ) ; return classpath ; }
|
Returns a list of file names for the specified library .
|
35,497
|
private void modified ( Dictionary < String , ? > newProperties , boolean logMessage ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "modified" , newProperties ) ; boolean replaced = false ; lock . writeLock ( ) . lock ( ) ; try { if ( isInitialized ) { if ( classloader != null ) { if ( isDerbyEmbedded . compareAndSet ( true , false ) ) shutdownDerbyEmbedded ( ) ; classloader = null ; } for ( Iterator < Class < ? extends CommonDataSource > > it = introspectedClasses . iterator ( ) ; it . hasNext ( ) ; it . remove ( ) ) Introspector . flushFromCaches ( it . next ( ) ) ; replaced = true ; isInitialized = false ; } if ( newProperties != null ) properties = newProperties ; } finally { lock . writeLock ( ) . unlock ( ) ; } if ( replaced ) try { setChanged ( ) ; notifyObservers ( ) ; } catch ( Throwable x ) { FFDCFilter . processException ( x , getClass ( ) . getName ( ) , "254" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , x . getMessage ( ) , AdapterUtil . stackTraceToString ( x ) ) ; } if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "modified" ) ; }
|
Clears the configuration of this JDBCDriverService so that it can lazily initialize with the new configuration on next use .
|
35,498
|
private static void setProperty ( Object obj , PropertyDescriptor pd , String value , boolean doTraceValue ) throws Exception { Object param = null ; String propName = pd . getName ( ) ; if ( tc . isDebugEnabled ( ) ) { if ( "URL" . equals ( propName ) || "url" . equals ( propName ) ) { Tr . debug ( tc , "set " + propName + " = " + PropertyService . filterURL ( value ) ) ; } else { Tr . debug ( tc , "set " + propName + " = " + ( doTraceValue ? value : "******" ) ) ; } } java . lang . reflect . Method setter = pd . getWriteMethod ( ) ; if ( setter == null ) throw new NoSuchMethodException ( AdapterUtil . getNLSMessage ( "NO_SETTER_METHOD" , propName ) ) ; Class < ? > paramType = setter . getParameterTypes ( ) [ 0 ] ; if ( ! paramType . isPrimitive ( ) ) { if ( paramType . equals ( String . class ) ) param = value ; else if ( paramType . equals ( Properties . class ) ) param = AdapterUtil . toProperties ( value ) ; else if ( paramType . equals ( Character . class ) ) param = Character . valueOf ( value . charAt ( 0 ) ) ; else param = paramType . getConstructor ( String . class ) . newInstance ( value ) ; } else if ( paramType . equals ( int . class ) ) param = Integer . valueOf ( value ) ; else if ( paramType . equals ( long . class ) ) param = Long . valueOf ( value ) ; else if ( paramType . equals ( boolean . class ) ) param = Boolean . valueOf ( value ) ; else if ( paramType . equals ( double . class ) ) param = Double . valueOf ( value ) ; else if ( paramType . equals ( float . class ) ) param = Float . valueOf ( value ) ; else if ( paramType . equals ( short . class ) ) param = Short . valueOf ( value ) ; else if ( paramType . equals ( byte . class ) ) param = Byte . valueOf ( value ) ; else if ( paramType . equals ( char . class ) ) param = Character . valueOf ( value . charAt ( 0 ) ) ; setter . invoke ( obj , new Object [ ] { param } ) ; }
|
Handles the setting of any property for which a public single - parameter setter exists on the DataSource and for which the property data type is either a primitive or has a single - parameter String constructor .
|
35,499
|
protected void setSharedLib ( Library lib ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "setSharedLib" , lib ) ; sharedLib = lib ; }
|
Declarative Services method for setting the SharedLibrary service
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.