idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
40,700
public String close ( ) { if ( instance == null ) { return null ; } try { container . close ( ) ; instance = null ; } catch ( IOException e ) { return e . getMessage ( ) ; } return null ; }
Release the jar file and null instance so that it can be deleted
40,701
public void clear ( ) { this . parentMap = null ; if ( null != this . values ) { for ( int i = 0 ; i < this . values . length ; i ++ ) { this . values [ i ] = null ; } this . values = null ; } }
Clear all content from this map . This will disconnect from any parent map as well .
40,702
public V get ( String name ) { V rc = null ; K key = getKey ( name ) ; if ( null != key ) { rc = get ( key ) ; } return rc ; }
Query the possible value associated with a named EventLocal . A null is returned if the name does not match any stored value or if that stored value is explicitly null .
40,703
private K getKey ( String name ) { if ( null != this . keys ) { final K [ ] temp = this . keys ; K key ; for ( int i = 0 ; i < temp . length ; i ++ ) { key = temp [ i ] ; if ( null != key && name . equals ( key . toString ( ) ) ) { return key ; } } } if ( null != this . parentMap ) { return this . parentMap . getKey ( name ) ; } return null ; }
Look for the key with the provided name . This returns null if no match is found .
40,704
public V get ( K key ) { return get ( key . hashCode ( ) / SIZE_ROW , key . hashCode ( ) % SIZE_ROW ) ; }
Query the value for the provided key .
40,705
public void put ( K key , V value ) { final int hash = key . hashCode ( ) ; final int row = hash / SIZE_ROW ; final int column = hash & ( SIZE_ROW - 1 ) ; validateKey ( hash ) ; validateTable ( row ) ; this . values [ row ] [ column ] = value ; this . keys [ hash ] = key ; }
Put a key and value pair into the storage map .
40,706
public V remove ( K key ) { final int hash = key . hashCode ( ) ; final int row = hash / SIZE_ROW ; final int column = hash & ( SIZE_ROW - 1 ) ; final V rc = get ( row , column ) ; validateKey ( hash ) ; validateTable ( row ) ; this . values [ row ] [ column ] = null ; this . keys [ hash ] = null ; return rc ; }
Remove a key from the storage .
40,707
@ SuppressWarnings ( "unchecked" ) private void validateKey ( int index ) { final int size = ( index + 1 ) ; if ( null == this . keys ) { this . keys = ( K [ ] ) new Object [ size ] ; } else if ( index >= this . keys . length ) { Object [ ] newKeys = new Object [ size ] ; System . arraycopy ( this . keys , 0 , newKeys , 0 , this . keys . length ) ; this . keys = ( K [ ] ) newKeys ; } }
Ensure that we have space in the local key array for the target index .
40,708
@ SuppressWarnings ( "unchecked" ) private void validateTable ( int targetRow ) { if ( null == this . values ) { int size = ( targetRow + 1 ) ; if ( SIZE_TABLE > size ) { size = SIZE_TABLE ; } this . values = ( V [ ] [ ] ) new Object [ size ] [ ] ; } else if ( targetRow >= this . values . length ) { final int size = ( targetRow + 1 ) ; Object [ ] [ ] newTable = new Object [ size ] [ ] ; System . arraycopy ( this . values , 0 , newTable , 0 , this . values . length ) ; this . values = ( V [ ] [ ] ) newTable ; } else if ( null != this . values [ targetRow ] ) { return ; } this . values [ targetRow ] = ( V [ ] ) new Object [ SIZE_ROW ] ; for ( int i = 0 ; i < SIZE_ROW ; i ++ ) { this . values [ targetRow ] [ i ] = ( V ) NO_VALUE ; } }
Validate that the storage table contains the provided row . This will allocate new space if that is required .
40,709
public String getRemoteEngineUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRemoteEngineUuid" ) ; String engineUUID = _anycastInputHandler . getLocalisationUuid ( ) . toString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getRemoteEngineUuid" , engineUUID ) ; return engineUUID ; }
Return the remote engine uuid
40,710
public RequestViewMetadata cloneInstance ( ) { RequestViewMetadata rvm = new RequestViewMetadata ( ) ; rvm . initialProcessedClasses = new HashMap < Class < ? > , Boolean > ( this . initialProcessedClasses != null ? this . initialProcessedClasses : this . processedClasses ) ; if ( this . initialAddedResources != null ) { rvm . initialAddedResources = new HashMap < ResourceDependency , Boolean > ( this . initialAddedResources ) ; } else if ( this . addedResources != null ) { rvm . initialAddedResources = new HashMap < ResourceDependency , Boolean > ( this . addedResources ) ; } return rvm ; }
Clone the current request view metadata into another instance so it can be used in a view .
40,711
public Object get ( int accessor ) { try { return getValue ( accessor ) ; } catch ( JMFException ex ) { FFDCFilter . processException ( ex , "get" , "134" , this ) ; return null ; } }
Other overridden methods .
40,712
private static final boolean containsAll ( LinkedHashMap < ThreadContextProvider , ThreadContext > contextProviders , List < ThreadContextProvider > prereqs ) { for ( ThreadContextProvider prereq : prereqs ) if ( ! contextProviders . containsKey ( prereq ) ) return false ; return true ; }
Utility method that indicates whether or not a list of thread context providers contains all of the specified prerequisites .
40,713
public static void notAvailable ( String jeeName , String taskName ) { String message ; int modSepIndex = jeeName . indexOf ( '#' ) ; if ( modSepIndex == - 1 ) { message = Tr . formatMessage ( tc , "CWWKC1011.app.unavailable" , taskName , jeeName ) ; } else { String application = jeeName . substring ( 0 , modSepIndex ) ; int compSepIndex = jeeName . indexOf ( '#' , modSepIndex + 1 ) ; if ( compSepIndex == - 1 ) { message = Tr . formatMessage ( tc , "CWWKC1012.module.unavailable" , taskName , jeeName . substring ( modSepIndex + 1 ) , application ) ; } else { String module = jeeName . substring ( modSepIndex + 1 , compSepIndex ) ; message = Tr . formatMessage ( tc , "CWWKC1013.component.unavailable" , taskName , jeeName . substring ( compSepIndex + 1 ) , module , application ) ; } } throw new IllegalStateException ( message ) ; }
Raises IllegalStateException because the application or application component is unavailable .
40,714
public byte [ ] serialize ( ) throws IOException { ByteArrayOutputStream bout = new ByteArrayOutputStream ( ) ; int size = threadContext . size ( ) ; byte [ ] [ ] contextBytes = new byte [ size ] [ ] ; for ( int i = 0 ; i < size ; i ++ ) { bout . reset ( ) ; ObjectOutputStream oout = new ObjectOutputStream ( bout ) ; oout . writeObject ( threadContext . get ( i ) ) ; oout . flush ( ) ; contextBytes [ i ] = bout . toByteArray ( ) ; oout . close ( ) ; } bout . reset ( ) ; ObjectOutputStream oout = new ObjectOutputStream ( bout ) ; oout . writeShort ( 3 ) ; oout . writeObject ( contextBytes ) ; oout . writeObject ( metaDataIdentifier ) ; oout . writeShort ( providerNames . size ( ) ) ; for ( String providerName : providerNames ) if ( providerName . startsWith ( "com.ibm.ws." ) && providerName . endsWith ( ".context.provider" ) ) oout . writeObject ( providerName . substring ( 10 , providerName . length ( ) - 16 ) ) ; else oout . writeObject ( providerName ) ; oout . flush ( ) ; oout . close ( ) ; return bout . toByteArray ( ) ; }
Serializes this thread context descriptor to bytes .
40,715
public boolean isActive ( ) { FacesContext facesContext = FacesContext . getCurrentInstance ( ) ; if ( facesContext != null ) { return facesContext . getViewRoot ( ) != null ; } else { return false ; } }
The WindowContext is active once a current windowId is set for the current Thread .
40,716
public String getSubscriberID ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getSubscriberID" ) ; SibTr . exit ( this , tc , "getSubscriberID" , subscriptionID ) ; } return subscriptionID ; }
Returns the subscriberID .
40,717
public String [ ] getTopics ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getTopics" ) ; SibTr . exit ( this , tc , "getTopics" , topics ) ; } return topics ; }
Returns the array of topics .
40,718
public void removeTopic ( String topic ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeTopic" , topic ) ; SelectionCriteria [ ] tmp = selectionCriteriaList ; for ( int i = 0 ; i < selectionCriteriaList . length ; ++ i ) { if ( ( selectionCriteriaList [ i ] . getDiscriminator ( ) == null && topic == null ) || ( topic != null && selectionCriteriaList [ i ] . getDiscriminator ( ) . equals ( topic ) ) ) { if ( selectionCriteriaList . length == 1 ) { selectionCriteriaList = null ; topics = null ; } else { tmp = new SelectionCriteria [ selectionCriteriaList . length - 1 ] ; System . arraycopy ( selectionCriteriaList , 0 , tmp , 0 , i ) ; System . arraycopy ( selectionCriteriaList , i + 1 , tmp , i , selectionCriteriaList . length - i - 1 ) ; selectionCriteriaList = tmp ; this . topics = new String [ selectionCriteriaList . length ] ; for ( int t = 0 ; t < selectionCriteriaList . length ; t ++ ) { topics [ t ] = ( selectionCriteriaList [ t ] == null ) ? null : selectionCriteriaList [ t ] . getDiscriminator ( ) ; } } break ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeTopic" ) ; }
Remove a topic from the array of topics
40,719
public void setTopicSpaceUuid ( SIBUuid12 topicSpace ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setTopicSpaceUuid" , topicSpace ) ; this . topicSpaceUuid = topicSpace ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setTopicSpaceUuid" ) ; }
Sets the topic space .
40,720
public void setSubscriberID ( String subscriptionID ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setSubscriberID" , subscriptionID ) ; this . subscriptionID = subscriptionID ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setSubscriberID" ) ; }
Sets the subscriberID .
40,721
public boolean isSIBServerSubject ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "isSIBServerSubject" ) ; SibTr . exit ( this , tc , "isSIBServerSubject" , Boolean . valueOf ( isSIBServerSubject ) ) ; } return isSIBServerSubject ; }
Returns the isSIBServerSubject .
40,722
protected boolean isDurable ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "isDurable" ) ; SibTr . exit ( this , tc , "isDurable" , Boolean . valueOf ( durable ) ) ; } return durable ; }
Is this a durable subscription state
40,723
public void setDurable ( boolean isDurable ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setDurable" , Boolean . valueOf ( isDurable ) ) ; durable = isDurable ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setDurable" ) ; }
time for a durable subscription .
40,724
public boolean equalUser ( ConsumerDispatcherState subState ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "equalUser" ) ; boolean equal = equalUser ( subState . getUser ( ) , subState . isSIBServerSubject ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "equalUser" , Boolean . valueOf ( equal ) ) ; return equal ; }
Returns whether this object has the same values as the given object
40,725
public void setReady ( boolean ready ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setReady" , Boolean . valueOf ( ready ) ) ; this . ready = ready ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setReady" ) ; }
Sets the ready flag .
40,726
public boolean isNoLocal ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "isNoLocal" ) ; SibTr . exit ( this , tc , "isNoLocal" , Boolean . valueOf ( noLocal ) ) ; } return noLocal ; }
Returns the noLocal flag .
40,727
public void setNoLocal ( boolean noLocal ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setNoLocal" , Boolean . valueOf ( noLocal ) ) ; this . noLocal = noLocal ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setNoLocal" ) ; }
Sets the noLocal flag .
40,728
public void setDurableHome ( String val ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setDurableHome" , val ) ; durableHome = val ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setDurableHome" ) ; }
Set durableHome .
40,729
public void setIsCloned ( boolean isCloned ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setIsCloned" , Boolean . valueOf ( isCloned ) ) ; this . isCloned = isCloned ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setIsCloned" ) ; }
Sets the isCloned .
40,730
public void setTopicSpaceName ( String name ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setTopicSpaceName" , name ) ; topicSpaceName = name ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setTopicSpaceName" ) ; }
Sets the name of the topicspace that the subscription was made through
40,731
public String getTopicSpaceBusName ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getTopicSpaceBusName" ) ; SibTr . exit ( this , tc , "getTopicSpaceBusName" , topicSpaceBusName ) ; } return topicSpaceBusName ; }
Gets the busname of the topicspace that the subscription was made through
40,732
public void setTopicSpaceBusName ( String busname ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setTopicSpaceBusName" , busname ) ; topicSpaceBusName = busname ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setTopicSpaceBusName" ) ; }
Sets the busname of the topicspace that the subscription was made through
40,733
public SIBUuid8 getRemoteMEUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getRemoteMEUuid" ) ; SibTr . exit ( this , tc , "getRemoteMEUuid" , remoteMEUuid ) ; } return remoteMEUuid ; }
Retrieve the UUID of the ME that homes a remote durable subscription
40,734
public void setRemoteMEUuid ( SIBUuid8 remoteMEUuid ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setRemoteMEUuid" , remoteMEUuid ) ; this . remoteMEUuid = remoteMEUuid ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setRemoteMEUuid" ) ; }
Set the UUID of the ME that homes a remote durable subscription
40,735
public static boolean getXMLAsynchronousMethods ( boolean [ ] asynchMethodFlags , MethodInterface methodInterface , String [ ] methodNames , Class < ? > [ ] [ ] methodParamTypes , EnterpriseBean wccmEnterpriseBean ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; boolean asynchMethodFound = false ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getXMLAsynchronousMethods" , new Object [ ] { asynchMethodFlags , wccmEnterpriseBean , methodInterface } ) ; } if ( wccmEnterpriseBean . getKindValue ( ) == EnterpriseBean . KIND_SESSION && methodInterface != MethodInterface . SERVICE_ENDPOINT ) { Session sb = ( Session ) wccmEnterpriseBean ; List < AsyncMethod > asynchMethods = sb . getAsyncMethods ( ) ; for ( AsyncMethod am : asynchMethods ) { String methodName = am . getMethodName ( ) ; if ( methodName == null || "" . equals ( methodName . trim ( ) ) ) { Tr . error ( tc , "INVALID_ASYNC_METHOD_ELEMENT_MISSING_METHOD_NAME_CNTR0203E" , sb . getName ( ) ) ; throw new EJBConfigurationException ( "Async method declared without a required method-name" ) ; } List < String > parms = am . getMethodParamList ( ) ; if ( "*" . equals ( methodName ) && parms != null ) { Tr . error ( tc , "INVALID_ASYNC_METHOD_ELEMENT_SPECIFIED_PARMS_WITH_WILDCARD_METHOD_CNTR0204E" , sb . getName ( ) ) ; throw new EJBConfigurationException ( "Cannot specify parameters when specifying a wildcard method-name for async methods" ) ; } if ( "*" . equals ( methodName ) ) { for ( int i = 0 ; i < asynchMethodFlags . length ; i ++ ) { asynchMethodFlags [ i ] = true ; } asynchMethodFound = true ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getXMLAsynchronousMethods - all methods are marked async" ) ; } return asynchMethodFound ; } for ( int i = 0 ; i < methodNames . length ; i ++ ) { if ( methodNames [ i ] != null && methodNames [ i ] . equals ( methodName ) ) { if ( parms == null || DDUtil . methodParamsMatch ( parms , methodParamTypes [ i ] ) ) { asynchMethodFlags [ i ] = true ; asynchMethodFound = true ; } } } } if ( isTraceOn && tc . isDebugEnabled ( ) ) { for ( int i = 0 ; i < methodNames . length ; i ++ ) { Tr . debug ( tc , methodNames [ i ] + Arrays . toString ( methodParamTypes [ i ] ) + " == " + ( asynchMethodFlags [ i ] ? "Asynchronous" : "Synchronous" ) ) ; } } } else { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Not a session bean" ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getXMLAsynchronousMethods" ) ; } return ( asynchMethodFound ) ; }
F743 - 4582 Determines which methods on the specified Enterprise Bean should be marked asynchronous by updating the passed - in boolean array .
40,736
static Map < String , List < Method > > getBusinessMethodsByName ( BeanMetaData bmd ) { Map < String , List < Method > > methodsByName = new HashMap < String , List < Method > > ( ) ; collectBusinessMethodsByName ( methodsByName , bmd . methodInfos ) ; collectBusinessMethodsByName ( methodsByName , bmd . localMethodInfos ) ; return methodsByName ; }
Returns a map of method name to list of business methods .
40,737
static Method findMatchingMethod ( Map < String , List < Method > > methodsByName , com . ibm . ws . javaee . dd . ejb . Method me ) { List < Method > methods = methodsByName . get ( me . getMethodName ( ) ) ; if ( methods == null ) { return null ; } List < String > meParms = me . getMethodParamList ( ) ; if ( meParms == null ) { return methods . get ( 0 ) ; } for ( Method method : methods ) { if ( DDUtil . methodParamsMatch ( meParms , method . getParameterTypes ( ) ) ) { return method ; } } return null ; }
Finds the first matching method in a map of method name to list of methods .
40,738
public static final boolean methodsEqual ( Method remoteMethod , Method beanMethod ) { if ( ( remoteMethod == null ) || ( beanMethod == null ) ) { return false ; } if ( ! remoteMethod . getName ( ) . equals ( beanMethod . getName ( ) ) ) { return false ; } Class < ? > remoteMethodParamTypes [ ] = remoteMethod . getParameterTypes ( ) ; Class < ? > beanMethodParamTypes [ ] = beanMethod . getParameterTypes ( ) ; if ( remoteMethodParamTypes . length != beanMethodParamTypes . length ) { return false ; } for ( int i = 0 ; i < remoteMethodParamTypes . length ; i ++ ) { if ( ! remoteMethodParamTypes [ i ] . equals ( beanMethodParamTypes [ i ] ) ) { return false ; } } return true ; }
This utility method compares a method on the bean s remote interface with a method on the bean and returns true iff they are equal for the purpose of determining if the control descriptor associated with the bean method applies to the remote interface method . Equality in this case means the methods are identical except for the abstract modifier on the remote interface method .
40,739
public static final boolean homeMethodEquals ( Method homeMethod , Properties beanMethodProps ) { if ( ( homeMethod == null ) || ( beanMethodProps == null ) ) { return false ; } String homeMethodName = homeMethod . getName ( ) ; String beanMethodName = ( String ) beanMethodProps . get ( "Name" ) ; if ( ! homeMethodName . equals ( beanMethodName ) ) { return false ; } Class < ? > homeMethodParamTypes [ ] = homeMethod . getParameterTypes ( ) ; String beanMethodParamTypes [ ] = ( String [ ] ) beanMethodProps . get ( "ArgumentTypes" ) ; if ( homeMethodParamTypes . length != beanMethodParamTypes . length ) { return false ; } for ( int i = 0 ; i < homeMethodParamTypes . length ; i ++ ) { if ( ! homeMethodParamTypes [ i ] . getName ( ) . equals ( beanMethodParamTypes [ i ] ) ) { return false ; } } return true ; }
This utility method compares a method on the bean s home interface with a method on the bean and returns true iff they are equal for the purpose of determining if the control descriptor associated with the bean method applies to the remote interface method . Equality in this case means that the bean method has the same name as the home method and they have the same parameters .
40,740
public static long timeUnitToMillis ( long value , TimeUnit unit , boolean annotation , BeanMetaData bmd ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "timeUnitToMillis: " + value + unit ) ; } long timeout = value ; if ( timeout > 0 ) { timeout = TimeUnit . MILLISECONDS . convert ( value , unit ) ; if ( timeout == Long . MAX_VALUE || timeout == Long . MIN_VALUE ) { Tr . error ( tc , "STATEFUL_TIMEOUT_OVERFLOW_CNTR0309E" , new Object [ ] { bmd . getName ( ) , bmd . getModuleMetaData ( ) . getName ( ) , bmd . getModuleMetaData ( ) . getApplicationMetaData ( ) . getName ( ) , value , unit } ) ; throw new EJBConfigurationException ( "Conversion of stateful session timeout value of " + value + " " + unit + " to milliseconds resulted in overflow." ) ; } } else { if ( timeout == 0 ) { timeout = 1 ; } else if ( timeout == - 1 ) { timeout = 0L ; } else { Object [ ] parms = new Object [ ] { bmd . getName ( ) , bmd . getModuleMetaData ( ) . getName ( ) , bmd . getModuleMetaData ( ) . getApplicationMetaData ( ) . getName ( ) , timeout } ; if ( annotation ) { Tr . error ( tc , "NEGATIVE_STATEFUL_TIMEOUT_ANN_CNTR0311E" , parms ) ; } else { Tr . error ( tc , "NEGATIVE_STATEFUL_TIMEOUT_XML_CNTR0312E" , parms ) ; } throw new EJBConfigurationException ( "Stateful session timeout value of " + value + " " + unit + " is negative." ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "timeUnitToMillis: " + timeout ) ; } return timeout ; }
F743 - 6605 . 1 streamlined method .
40,741
protected UserTransaction getUserTransaction ( boolean injection , Object injectionContext ) throws NamingException { final UserTransaction ut = AccessController . doPrivileged ( new PrivilegedAction < UserTransaction > ( ) { public UserTransaction run ( ) { return userTranSvcRef . getBundle ( ) . getBundleContext ( ) . getService ( userTranSvcRef ) ; } } ) ; final UserTransactionDecorator utd = getUserTransactionDecorator ( ) ; if ( utd == null ) { return ut ; } else { return utd . decorateUserTransaction ( ut , injection , injectionContext ) ; } }
Helper method for use with injection TransactionObjectFactoruy .
40,742
private < T , V > boolean addToMap ( Map < Class < ? > , Map < T , V > > proxyMap , T f , V proxy ) { Map < T , V > proxies = proxyMap . get ( serviceClass ) ; if ( proxies == null ) { proxies = new HashMap < T , V > ( ) ; proxyMap . put ( serviceClass , proxies ) ; } if ( ! proxies . containsKey ( f ) ) { proxies . put ( f , proxy ) ; return true ; } return false ; }
Liberty code change start defect 182967
40,743
public TrustManagerFactory getTrustManagerFactoryInstance ( String trustMgr , String ctxtProvider ) throws NoSuchAlgorithmException , NoSuchProviderException { String mgr = trustMgr ; String provider = ctxtProvider ; if ( mgr . indexOf ( '|' ) != - 1 ) { String [ ] trustManagerArray = mgr . split ( "\\|" ) ; if ( trustManagerArray != null && trustManagerArray . length == 2 ) { mgr = trustManagerArray [ 0 ] ; provider = trustManagerArray [ 1 ] ; } } TrustManagerFactory rc = TrustManagerFactory . getInstance ( mgr , provider ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getTrustManagerFactory.getInstance(" + mgr + ", " + provider + ")" + rc ) ; return rc ; }
Get the trust manager factory instance using the provided information .
40,744
public KeyManagerFactory getKeyManagerFactoryInstance ( String keyMgr , String ctxtProvider ) throws NoSuchAlgorithmException , NoSuchProviderException { String mgr = keyMgr ; String provider = ctxtProvider ; if ( mgr . indexOf ( '|' ) != - 1 ) { String [ ] keyManagerArray = mgr . split ( "\\|" ) ; if ( keyManagerArray != null && keyManagerArray . length == 2 ) { mgr = keyManagerArray [ 0 ] ; provider = keyManagerArray [ 1 ] ; } } KeyManagerFactory rc = KeyManagerFactory . getInstance ( mgr , provider ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getKeyManagerFactory.getInstance(" + mgr + ", " + provider + ") " + rc ) ; return rc ; }
Get the key manager factory instance using the provided information .
40,745
public URLStreamHandler getHandler ( ) throws Exception { String handlerString = getSSLProtocolPackageHandler ( ) + ".https.Handler" ; URLStreamHandler streamHandler = null ; try { ClassLoader cl = AccessController . doPrivileged ( getCtxClassLoader ) ; if ( cl != null ) { streamHandler = ( URLStreamHandler ) cl . loadClass ( handlerString ) . newInstance ( ) ; } else { streamHandler = ( URLStreamHandler ) Class . forName ( handlerString ) . newInstance ( ) ; } return streamHandler ; } catch ( Exception e ) { FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "getHandler" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception loading https stream handler." , new Object [ ] { e } ) ; Tr . error ( tc , "ssl.load.https.stream.handler.CWPKI0025E" , new Object [ ] { handlerString , e . getMessage ( ) } ) ; throw e ; } }
Query the default handler for this provider using HTTPS .
40,746
private X509KeyManager loadCustomKeyManager ( String kmClass ) throws Exception { X509KeyManager km = null ; try { ClassLoader cl = AccessController . doPrivileged ( getCtxClassLoader ) ; if ( cl != null ) { try { km = ( X509KeyManager ) cl . loadClass ( kmClass ) . newInstance ( ) ; } catch ( Exception e ) { } } if ( km == null ) { km = ( X509KeyManager ) Class . forName ( kmClass ) . newInstance ( ) ; } return km ; } catch ( Exception e ) { FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "loadCustomKeyManager" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception loading custom KeyManager." , new Object [ ] { e } ) ; Tr . error ( tc , "ssl.load.keymanager.error.CWPKI0021E" , new Object [ ] { kmClass , e . getMessage ( ) } ) ; throw e ; } }
this loads the KeyManager class if present
40,747
public static void clearSSLContextCache ( ) { if ( sslContextCacheJAVAX != null && sslContextCacheJAVAX . size ( ) > 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Clearing standard javax.net.ssl.SSLContext cache." ) ; sslContextCacheJAVAX . clear ( ) ; } }
Clear the contents of the SSLContext cache .
40,748
public static void clearSSLContextCache ( Collection < File > modifiedFiles ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Clearing standard javax.net.ssl.SSLContext cached object containing keystores: " + new Object [ ] { modifiedFiles } ) ; for ( File modifiedKeystoreFile : modifiedFiles ) { String filePath = null ; try { filePath = modifiedKeystoreFile . getCanonicalPath ( ) ; } catch ( IOException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception comparing file path." ) ; continue ; } removeEntryFromSSLContextMap ( filePath ) ; } }
Clear the contents of the SSLContext cache if it uses the files passed in
40,749
public static void removeEntryFromSSLContextMap ( String keyStorePath ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "removeEntryFromSSLContextMap: " + new Object [ ] { keyStorePath } ) ; List < SSLConfig > removeList = new ArrayList < SSLConfig > ( ) ; for ( Entry < SSLConfig , SSLContext > entry : sslContextCacheJAVAX . entrySet ( ) ) { SSLConfig cachedConfig = entry . getKey ( ) ; if ( cachedConfig != null ) { String ksPropValue = cachedConfig . getProperty ( Constants . SSLPROP_KEY_STORE , null ) ; boolean ksFileBased = Boolean . parseBoolean ( cachedConfig . getProperty ( Constants . SSLPROP_KEY_STORE_FILE_BASED ) ) ; String tsPropValue = cachedConfig . getProperty ( Constants . SSLPROP_TRUST_STORE , null ) ; boolean tsFileBased = Boolean . parseBoolean ( cachedConfig . getProperty ( Constants . SSLPROP_TRUST_STORE_FILE_BASED ) ) ; if ( ( ksPropValue != null && keyStorePath . equals ( WSKeyStore . getCannonicalPath ( ksPropValue , ksFileBased ) ) ) || ( tsPropValue != null && keyStorePath . equals ( WSKeyStore . getCannonicalPath ( tsPropValue , tsFileBased ) ) ) ) { removeList . add ( cachedConfig ) ; } } } if ( ! removeList . isEmpty ( ) ) { for ( SSLConfig removeEntry : removeList ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "removing from sslContext cache: " + removeEntry . toString ( ) ) ; sslContextCacheJAVAX . remove ( removeEntry ) ; } } }
Give a keyStoreFile location look for the SSLContexts that reference it as either a keystore or truststore then remove those SSLContexts from the cache .
40,750
public synchronized Entry next ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "next" ) ; checkEntryParent ( ) ; Entry nextEntry = null ; synchronized ( parentList ) { nextEntry = getNextEntry ( ) ; if ( nextEntry == null ) { if ( current == parentList . last ) { moveToBottom ( ) ; } else if ( ! atBottom ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "Cursor" , "1:160:1.15" } , null ) ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.utils.linkedlist.Cursor.next" , "1:166:1.15" , this ) ; SibTr . exception ( tc , e ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "next" , e ) ; throw e ; } } else { moveCursor ( nextEntry ) ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "next" , nextEntry ) ; return nextEntry ; }
Synchronized . Move the cursor down to the next entry in the list and return it .
40,751
public synchronized Entry previous ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "previous" ) ; checkEntryParent ( ) ; Entry previousEntry = null ; synchronized ( parentList ) { previousEntry = getPreviousEntry ( ) ; if ( previousEntry == null ) { if ( current == parentList . first ) { moveToTop ( ) ; } else if ( ! atTop ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.utils.linkedlist.Cursor" , "1:228:1.15" } , null ) ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.utils.linkedlist.Cursor.previous" , "1:234:1.15" , this ) ; SibTr . exception ( tc , e ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "previous" , e ) ; throw e ; } } else { moveCursor ( previousEntry ) ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "previous" , previousEntry ) ; return previousEntry ; }
Synchronized . Move the cursor up to the previous entry in the list and return it .
40,752
public synchronized Entry current ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "current" ) ; checkEntryParent ( ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "current" , current ) ; return current ; }
Synchronized . Get the entry currently pointed to by this cursor .
40,753
public synchronized void moveToTop ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "moveToTop" ) ; checkEntryParent ( ) ; LinkedList list = parentList ; synchronized ( list ) { forceRemove ( ) ; parentList = list ; atTop = true ; next = list . firstTopCursor ; if ( next != null ) next . previous = this ; list . firstTopCursor = this ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "moveToTop" ) ; }
Synchronized . Move the cursor to the top of the list .
40,754
public synchronized void moveToBottom ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "moveToBottom" ) ; checkEntryParent ( ) ; LinkedList list = parentList ; synchronized ( list ) { forceRemove ( ) ; parentList = list ; atBottom = true ; next = list . firstBottomCursor ; if ( next != null ) next . previous = this ; list . firstBottomCursor = this ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "moveToBottom" ) ; }
Synchronized . Move the cursor to the bottom of the list .
40,755
public synchronized void moveCursor ( Entry newEntry ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "moveCursor" , new Object [ ] { newEntry } ) ; checkEntryParent ( ) ; if ( newEntry != current ) { if ( newEntry != null && newEntry . parentList == parentList ) { LinkedList list = parentList ; synchronized ( list ) { forceRemove ( ) ; next = newEntry . firstCursor ; if ( next != null ) next . previous = this ; newEntry . firstCursor = this ; previous = null ; parentList = list ; current = newEntry ; } } else { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.utils.linkedlist.Cursor" , "1:457:1.15" } , null ) ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.utils.linkedlist.Cursor.moveCursor" , "1:463:1.15" , this ) ; SibTr . exception ( tc , e ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "moveCursor" , e ) ; throw e ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "moveCursor" ) ; }
Synchronized . Move this cursor to point at a different entry in the same list .
40,756
public synchronized void moveCursor ( Cursor cursor ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "moveCursor" , new Object [ ] { cursor } ) ; checkEntryParent ( ) ; synchronized ( parentList ) { if ( cursor != null && cursor . parentList == parentList ) { if ( cursor . current != current ) { if ( cursor . atTop ) { moveToTop ( ) ; } else if ( cursor . atBottom ) { moveToBottom ( ) ; } else { moveCursor ( cursor . current ) ; } } else { if ( cursor . current == null ) { if ( cursor . atTop && atBottom ) { moveToTop ( ) ; } else if ( cursor . atBottom && atTop ) { moveToBottom ( ) ; } } } } else { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.utils.linkedlist.Cursor" , "1:541:1.15" } , null ) ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.utils.linkedlist.Cursor.moveCursor" , "1:547:1.15" , this ) ; SibTr . exception ( tc , e ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "moveCursor" , e ) ; throw e ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "moveCursor" ) ; }
Synchronized . Move this cursor to point at the same one as a given cursor .
40,757
Entry forceRemove ( ) { Entry removedEntry = null ; checkEntryParent ( ) ; if ( atTop ) { if ( parentList . firstTopCursor == this ) { parentList . firstTopCursor = ( Cursor ) next ; } atTop = false ; } else if ( atBottom ) { if ( parentList . firstBottomCursor == this ) { parentList . firstBottomCursor = ( Cursor ) next ; } atBottom = false ; } else { if ( current . firstCursor == this ) { current . firstCursor = ( Cursor ) next ; } current = null ; } removedEntry = super . forceRemove ( ) ; return removedEntry ; }
Not Synchronized .
40,758
public synchronized void finished ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "finished" ) ; checkEntryParent ( ) ; synchronized ( parentList ) { forceRemove ( ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "finished" ) ; }
Synchronized . Indicate that this cursor is finished with . This call will remove this cursor from the list and make it subsequently unusable .
40,759
public JsMessage getMessageIfAvailable ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getMessageIfAvailable" ) ; boolean throwExceptionIfNotAvailable = false ; JsMessage localMsg = getJSMessage ( throwExceptionIfNotAvailable ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getMessageIfAvailable" , localMsg ) ; return localMsg ; }
Get the underlying message object only if the message is available in the message store
40,760
public int getInMemoryDataSize ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getInMemoryDataSize" ) ; JsMessage localMsg = getJSMessage ( true ) ; int msgSize = localMsg . getInMemorySize ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getInMemoryDataSize" , Integer . valueOf ( msgSize ) ) ; return msgSize ; }
Returns an estimated in memory size for the Message that we have .
40,761
public Reliability getReliability ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getReliability" ) ; if ( msgReliability == null ) { JsMessage localMsg = getJSMessage ( true ) ; msgReliability = localMsg . getReliability ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getReliability" , msgReliability ) ; return msgReliability ; }
Get the message s Reliability
40,762
public void setReliability ( Reliability reliability ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setReliability" , reliability ) ; JsMessage localMsg = getJSMessage ( true ) ; msgReliability = reliability ; localMsg . setReliability ( msgReliability ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setReliability" ) ; }
Sets both the cached version of the reliability and the reliability in the underlying message .
40,763
public long getMaximumTimeInStore ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getMaximumTimeInStore" ) ; JsMessage localMsg = getJSMessage ( true ) ; long timeToLive = localMsg . getTimeToLive ( ) . longValue ( ) ; long maxTime = NEVER_EXPIRES ; if ( timeToLive > 0 ) { maxTime = timeToLive - getAggregateWaitTime ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getMaximumTimeInStore" , Long . valueOf ( maxTime ) ) ; return maxTime ; }
Return the maximum time this message should spend in the ItemStream .
40,764
public SIBUuid12 getProducerConnectionUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getProducerConnectionUuid" ) ; } if ( producerConnectionUuid == null ) { JsMessage localMsg = getJSMessage ( true ) ; producerConnectionUuid = localMsg . getConnectionUuid ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( this , tc , "getProducerConnectionUuid" , producerConnectionUuid ) ; } return producerConnectionUuid ; }
Returns the producerConnectionUuid . Please note this value may be null in the case of a p2p message .
40,765
public void setProducerConnectionUuid ( SIBUuid12 producerConnectionUuid ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setProducerConnectionUuid" , producerConnectionUuid ) ; this . producerConnectionUuid = producerConnectionUuid ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setProducerConnectionUuid" ) ; }
Sets the producerConnectionUuid .
40,766
public boolean isTransacted ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "isTransacted" ) ; SibTr . exit ( this , tc , "isTransacted" , Boolean . valueOf ( transacted ) ) ; } return transacted ; }
Was this message put transactionally
40,767
public void setMaxStorageStrategy ( int requestedMaxStrategy ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setMaxStorageStrategy" , Integer . valueOf ( requestedMaxStrategy ) ) ; maxStorageStrategy = requestedMaxStrategy ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setMaxStorageStrategy" ) ; }
Set the maximum storage strategy permitted
40,768
public void setPriority ( int newPriority ) { JsMessage localMsg = getJSMessage ( true ) ; msgPriority = newPriority ; localMsg . setPriority ( newPriority ) ; }
Set the message priority and cache it
40,769
public void addPersistentRef ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "addPersistentRef" ) ; maintainPersistence = 1 ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "addPersistentRef" ) ; }
Note the existence of a persistent reference
40,770
private void setOriginatingBus ( String busName ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setOriginatingBus" , busName ) ; _busName = busName ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setOriginatingBus" ) ; }
Sets the previous hop Bus name
40,771
public String getOriginatingBus ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getOriginatingBus" ) ; SibTr . exit ( this , tc , "getOriginatingBus" , _busName ) ; } return _busName ; }
Gets the bus that the message was previously at .
40,772
public void forceCurrentMEArrivalTimeToJsMessage ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "forceCurrentMEArrivalTimeToJsMessage" ) ; if ( ! arrivalTimeStored ) { JsMessage localMsg = getJSMessage ( true ) ; localMsg . setCurrentMEArrivalTimestamp ( currentMEArrivalTimeStamp ) ; arrivalTimeStored = true ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "forceCurrentMEArrivalTimeToJsMessage" ) ; }
Forces the local messageItem currentMEArrivalTime value to be set to the JsMessage rather than wait till the data has been spilled to the db .
40,773
public void unlockMsg ( long lockID , Transaction transaction , boolean incrementUnlock ) throws MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "unlockMsg" , new Object [ ] { Long . valueOf ( lockID ) , transaction , Boolean . valueOf ( incrementUnlock ) } ) ; if ( failedInitInRestore ) { initialiseNonPersistent ( true ) ; } if ( incrementUnlock ) { redeliveryCountReached = false ; try { if ( PRE_UNLOCKED_1 != null ) { PRE_UNLOCKED_1 . messageEventOccurred ( MessageEvents . PRE_UNLOCKED , this , transaction ) ; } if ( PRE_UNLOCKED_2 != null ) { PRE_UNLOCKED_2 . messageEventOccurred ( MessageEvents . PRE_UNLOCKED , this , transaction ) ; } } catch ( SIException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.items.MessageItem.unlockMsg" , "1:2955:1.244.1.40" , this ) ; SibTr . exception ( tc , e ) ; redeliveryCountReached = false ; } } if ( ! redeliveryCountReached ) { unlock ( lockID , transaction , incrementUnlock ) ; SIMPItemStream itemStream = ( SIMPItemStream ) getItemStream ( ) ; BaseDestinationHandler bdh = getDestinationHandler ( false , itemStream ) ; if ( bdh . isRedeliveryCountPersisted ( ) && bdh . getMessageProcessor ( ) . getMessageStore ( ) . isRedeliveryCountColumnAvailable ( ) ) { int rdl_count = guessRedeliveredCount ( ) ; persistRedeliveredCount ( rdl_count ) ; if ( msg != null ) msg . setRedeliveredCount ( rdl_count ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockMsg" ) ; }
unlockMsg - call any registered callbacks before we unlock the message N . B All MP unlocking should go through this method
40,774
public void setRegisterForPostEvents ( boolean registerEvents ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "setRegisterForPostEvents" , Boolean . valueOf ( registerEvents ) ) ; SibTr . exit ( this , tc , "setRegisterForPostEvents" ) ; } this . registerEvents = registerEvents ; }
sets whether event listeners has to be registered for post events
40,775
public void addAll ( PriorityConverterMap convertersToAdd ) { for ( PriorityConverter converter : convertersToAdd . converters . values ( ) ) { _addConverter ( converter ) ; } }
Add all of the converters from the given map to this one ... if they have a higher priority as above
40,776
public PriorityConverter getConverter ( Type type ) { PriorityConverter converter = converters . get ( type ) ; return converter ; }
Get a converter for the given type
40,777
public static Version stringToVersion ( String str ) { if ( str == null || str . isEmpty ( ) || str . equals ( "0" ) ) { return Version . emptyVersion ; } if ( str . equals ( "1" ) || str . equals ( "1.0" ) || str . equals ( "1.0.0" ) ) return VERSION_1_0 ; return new Version ( str ) ; }
Convert a string into a Version reusing common Version objects if we can .
40,778
public static final VersionRange stringToVersionRange ( String str ) { if ( str == null || str . isEmpty ( ) || "0" . equals ( str ) ) return EMPTY_RANGE ; if ( "[1,1.0.100)" . equals ( str ) || "[1.0,1.0.100)" . equals ( str ) || "[1.0.0,1.0.100)" . equals ( str ) ) return INITIAL_RANGE ; return new VersionRange ( str ) ; }
Convert a string into a VersionRange reusing common VersionRange objects if we can .
40,779
public void setAttribute ( String name , String value ) { this . myAttrs . put ( name . toLowerCase ( ) , value ) ; }
Set a generic attribute on this cookie .
40,780
public String getServletURI ( HttpServletRequest req ) { String uriName = req . getServletPath ( ) ; String pathInfo = req . getPathInfo ( ) ; if ( pathInfo != null ) uriName = uriName . concat ( pathInfo ) ; if ( uriName == null || uriName . length ( ) == 0 ) uriName = "/" ; uriName = WSUtil . resolveURI ( uriName ) ; int sindex ; if ( ( sindex = uriName . indexOf ( ";" ) ) != - 1 ) { uriName = uriName . substring ( 0 , sindex ) ; } if ( uriName . indexOf ( ":" ) >= 0 ) { uriName = uriName . replaceAll ( ":" , "%3A" ) ; } return uriName ; }
Return the full servlet path including any additional path info .
40,781
void fireProgressEvent ( int state , int progress , String message ) { try { fireProgressEvent ( state , progress , message , false ) ; } catch ( InstallException e ) { } }
Creates a Progress event message .
40,782
void fireProgressEvent ( int state , int progress , String message , boolean allowCancel ) throws InstallException { log ( Level . FINEST , message ) ; if ( enableEvent ) { try { eventManager . fireProgressEvent ( state , progress , message ) ; } catch ( CancelException ce ) { if ( allowCancel ) throw ce ; else log ( Level . FINEST , "fireProgressEvent caught cancel exception: " + ce . getMessage ( ) ) ; } catch ( Exception e ) { log ( Level . FINEST , "fireProgressEvent caught exception: " + e . getMessage ( ) ) ; } } }
Creates a Progress event message that can handle cancel exceptions .
40,783
void log ( Level level , String msg , Exception e ) { if ( e != null ) logger . log ( level , msg , e ) ; }
Logs a message with an exception .
40,784
boolean isEmpty ( Map < String , List < List < RepositoryResource > > > installResources ) { if ( installResources == null ) return true ; for ( List < List < RepositoryResource > > targetList : installResources . values ( ) ) { for ( List < RepositoryResource > mrList : targetList ) { if ( ! mrList . isEmpty ( ) ) return false ; } } return true ; }
Checks if installResources map contains any resources
40,785
boolean isEmpty ( List < List < RepositoryResource > > installResources ) { if ( installResources == null ) return true ; for ( List < RepositoryResource > mrList : installResources ) { if ( ! mrList . isEmpty ( ) ) return false ; } return true ; }
Checks if installResources contains any resources
40,786
boolean containFeature ( Map < String , ProvisioningFeatureDefinition > installedFeatures , String feature ) { if ( installedFeatures . containsKey ( feature ) ) return true ; for ( ProvisioningFeatureDefinition pfd : installedFeatures . values ( ) ) { String shortName = InstallUtils . getShortName ( pfd ) ; if ( shortName != null && shortName . equalsIgnoreCase ( feature ) ) return true ; } return false ; }
Checks if the feature is in installedFeatures
40,787
Collection < String > getFeaturesToInstall ( Collection < String > requiredFeatures , boolean download ) { Collection < String > featuresToInstall = new ArrayList < String > ( requiredFeatures . size ( ) ) ; if ( ! requiredFeatures . isEmpty ( ) ) { Map < String , ProvisioningFeatureDefinition > installedFeatures = product . getFeatureDefinitions ( ) ; for ( String feature : requiredFeatures ) { if ( download || ! containFeature ( installedFeatures , feature ) ) featuresToInstall . add ( feature ) ; } } return featuresToInstall ; }
Creates a collection of features that still need to be installed
40,788
boolean containScript ( List < File > filesInstalled ) { for ( File f : filesInstalled ) { String path = f . getAbsolutePath ( ) . toLowerCase ( ) ; if ( path . contains ( "/bin/" ) || path . contains ( "\\bin\\" ) ) { return true ; } } return false ; }
Checks if filesInstalled includes scripts in a bin folder .
40,789
public static String getNameOfReferenceableItem ( Object annotation ) { if ( annotation == null ) { return "" ; } String name = "" , ref = "" ; if ( annotation instanceof org . eclipse . microprofile . openapi . annotations . headers . Header ) { name = ( ( org . eclipse . microprofile . openapi . annotations . headers . Header ) annotation ) . name ( ) ; ref = ( ( org . eclipse . microprofile . openapi . annotations . headers . Header ) annotation ) . ref ( ) ; } else if ( annotation instanceof ExampleObject ) { name = ( ( ExampleObject ) annotation ) . name ( ) ; ref = ( ( ExampleObject ) annotation ) . ref ( ) ; } else if ( annotation instanceof org . eclipse . microprofile . openapi . annotations . links . Link ) { name = ( ( org . eclipse . microprofile . openapi . annotations . links . Link ) annotation ) . name ( ) ; ref = ( ( org . eclipse . microprofile . openapi . annotations . links . Link ) annotation ) . ref ( ) ; } else if ( annotation instanceof Callback ) { name = ( ( Callback ) annotation ) . name ( ) ; ref = ( ( Callback ) annotation ) . ref ( ) ; } if ( StringUtils . isBlank ( name ) ) { if ( StringUtils . isNotBlank ( ref ) ) { int index = ref . lastIndexOf ( '/' ) ; return index == - 1 ? ref : ref . substring ( index + 1 ) ; } } return name ; }
Retrieve the name
40,790
public int getExactSubsSize ( String topicExpression ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getExactSubsSize" , topicExpression ) ; int numSubs = 0 ; if ( ! _registeredExactConsumerMonitors . isEmpty ( ) ) { if ( _registeredExactConsumerMonitors . containsKey ( topicExpression ) ) { RegisteredCallbacks rMonitor = ( RegisteredCallbacks ) _registeredExactConsumerMonitors . get ( topicExpression ) ; ArrayList consumerList = rMonitor . getMatchingConsumers ( ) ; if ( consumerList != null && ! consumerList . isEmpty ( ) ) { numSubs = consumerList . size ( ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getExactSubsSize" , new Integer ( numSubs ) ) ; return numSubs ; }
Methods for integrity checks - used in unit testing
40,791
@ FFDCIgnore ( value = { Exception . class } ) public void setSimpleDateFormat ( String formatString ) { if ( formatString == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Null format string provided; date format will not be changed" ) ; } return ; } try { simpleDateFormat = new SimpleDateFormat ( formatString ) ; } catch ( Exception e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception caught setting date format: " + e . getMessage ( ) ) ; Tr . debug ( tc , "Date format will not be changed" ) ; } } }
Set the SimpleDateFormat string that should be used to format date strings created by this class .
40,792
public void cleanUpMaybeDiscriminatorState ( ) { if ( this . dp != null ) { Discriminator d ; Iterator < Discriminator > it = this . dp . getDiscriminators ( ) . iterator ( ) ; int i = 0 ; while ( it . hasNext ( ) ) { d = it . next ( ) ; if ( Discriminator . MAYBE == this . discStatus [ i ++ ] ) { d . cleanUpState ( this ) ; } } } }
Clean up potential state information left in this VC from any of the discriminators in the group which resulted in MAYBE during the discrimination process .
40,793
public void cleanUpAllDiscriminatorState ( ) { if ( this . dp != null ) { Iterator < Discriminator > it = this . dp . getDiscriminators ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { it . next ( ) . cleanUpState ( this ) ; } } }
Clean up potential state information left in this VC from any of the discriminators in the group .
40,794
public ContextualStorage getContextualStorage ( BeanManager beanManager , String flowClientWindowId ) { ContextualStorage contextualStorage = storageMap . get ( flowClientWindowId ) ; if ( contextualStorage == null ) { synchronized ( this ) { contextualStorage = storageMap . get ( flowClientWindowId ) ; if ( contextualStorage == null ) { contextualStorage = new ContextualStorage ( beanManager , true , true ) ; storageMap . put ( flowClientWindowId , contextualStorage ) ; } } } return contextualStorage ; }
This method will return the ContextualStorage or create a new one if no one is yet assigned to the current flowClientWindowId .
40,795
public void destroyBeansOnPreDestroy ( ) { Map < String , ContextualStorage > oldWindowContextStorages = forceNewStorage ( ) ; if ( ! oldWindowContextStorages . isEmpty ( ) ) { FacesContext facesContext = FacesContext . getCurrentInstance ( ) ; ServletContext servletContext = null ; if ( facesContext == null ) { try { servletContext = applicationContextBean . getServletContext ( ) ; } catch ( Throwable e ) { Logger . getLogger ( FlowScopeBeanHolder . class . getName ( ) ) . log ( Level . WARNING , "Cannot locate servletContext to create FacesContext on @PreDestroy flow scope beans. " + "The beans will be destroyed without active FacesContext instance." ) ; servletContext = null ; } } if ( facesContext == null && servletContext != null ) { try { ExternalContext externalContext = new StartupServletExternalContextImpl ( servletContext , false ) ; ExceptionHandler exceptionHandler = new ExceptionHandlerImpl ( ) ; facesContext = new StartupFacesContextImpl ( externalContext , ( ReleaseableExternalContext ) externalContext , exceptionHandler , false ) ; for ( ContextualStorage contextualStorage : oldWindowContextStorages . values ( ) ) { FlowScopedContextImpl . destroyAllActive ( contextualStorage ) ; } } finally { facesContext . release ( ) ; } } else { for ( ContextualStorage contextualStorage : oldWindowContextStorages . values ( ) ) { FlowScopedContextImpl . destroyAllActive ( contextualStorage ) ; } } } }
See description on ViewScopeBeanHolder for details about how this works
40,796
private void printValueIntro ( String text ) { if ( text != null ) { ffdcLog . print ( text ) ; ffdcLog . print ( EQUALS ) ; } }
Print the introductory text for a value
40,797
public static String getCookieValue ( Cookie [ ] cookies , String cookieName ) { if ( cookies == null ) { return null ; } String retVal = null ; for ( int i = 0 ; i < cookies . length ; ++ i ) { if ( cookieName . equalsIgnoreCase ( cookies [ i ] . getName ( ) ) ) { retVal = cookies [ i ] . getValue ( ) ; break ; } } return retVal ; }
Retrieve the value of the first instance of the specified Cookie name from the array of Cookies . Note name matching ignores case .
40,798
public static String [ ] getCookieValues ( Cookie [ ] cookies , String cookieName ) { if ( cookies == null ) { return null ; } Vector < String > retValues = new Vector < String > ( ) ; for ( int i = 0 ; i < cookies . length ; ++ i ) { if ( cookieName . equalsIgnoreCase ( cookies [ i ] . getName ( ) ) ) { retValues . add ( cookies [ i ] . getValue ( ) ) ; } } if ( retValues . size ( ) > 0 ) { return retValues . toArray ( new String [ retValues . size ( ) ] ) ; } else { return null ; } }
Retrieve the value of the all instances of the specified Cookie name from the array of Cookies . Note name matching ignores case .
40,799
public static void addCookiesToResponse ( List < Cookie > cookieList , HttpServletResponse resp ) { Iterator < Cookie > iterator = cookieList . listIterator ( ) ; while ( iterator . hasNext ( ) ) { Cookie cookie = iterator . next ( ) ; if ( cookie != null ) { resp . addCookie ( cookie ) ; } } }
Given a list of Cookie objects set them into the HttpServletResponse . This method does not alter the cookies in any way .