idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
39,600
private void validatePossibleEndpoint ( String possibleEndpoint ) throws IllegalArgumentException { if ( ! possibleEndpoint . contains ( ":" ) ) { throw new IllegalArgumentException ( RESTClientMessagesUtil . getMessage ( RESTClientMessagesUtil . INVALID_ENDPOINT , possibleEndpoint ) ) ; } String [ ] components = possibleEndpoint . split ( ":" ) ; if ( components . length != 2 ) { throw new IllegalArgumentException ( RESTClientMessagesUtil . getMessage ( RESTClientMessagesUtil . INVALID_ENDPOINT , possibleEndpoint ) ) ; } try { Integer . valueOf ( components [ 1 ] ) ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( RESTClientMessagesUtil . getMessage ( RESTClientMessagesUtil . INVALID_ENDPOINT , possibleEndpoint ) ) ; } }
Validate the possible endpoint String .
39,601
private Set < String > validatePathAndRetrievePathParams ( ValidationHelper helper , Context context , String pathStr ) { String pathToCheck = pathStr ; Set < String > pathParameters = new HashSet < String > ( ) ; while ( pathToCheck . contains ( "{" ) ) { if ( ! pathToCheck . contains ( "}" ) ) { final String message = Tr . formatMessage ( tc , "pathItemInvalidFormat" , pathStr ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( ) , message ) ) ; return pathParameters ; } int firstIndex = pathToCheck . indexOf ( "{" ) ; int lastIndex = pathToCheck . indexOf ( "}" ) ; if ( firstIndex > lastIndex ) { final String message = Tr . formatMessage ( tc , "pathItemInvalidFormat" , pathStr ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( ) , message ) ) ; return pathParameters ; } String parameter = pathToCheck . substring ( firstIndex + 1 , lastIndex ) ; if ( parameter . isEmpty ( ) || parameter . contains ( "{" ) || parameter . contains ( "/" ) ) { final String message = Tr . formatMessage ( tc , "pathItemInvalidFormat" , pathStr ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( ) , message ) ) ; return pathParameters ; } pathParameters . add ( parameter ) ; pathToCheck = pathToCheck . substring ( lastIndex + 1 ) ; } if ( pathToCheck . contains ( "}" ) ) { final String message = Tr . formatMessage ( tc , "pathItemInvalidFormat" , pathStr ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( ) , message ) ) ; return pathParameters ; } return pathParameters ; }
Validate the path and extract path parameters
39,602
public CompositeEnumeration < T > add ( Enumeration < T > enumeration ) { if ( enumeration . hasMoreElements ( ) ) enumerations . add ( enumeration ) ; return this ; }
Fluent method for chaining additions of subsequent enumerations .
39,603
public synchronized void incrementUseCount ( ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "incrementUseCount" ) ; if ( dead ) { setOrderingContextProxyId ( ) ; dead = false ; } useCount ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Use count is now: " + useCount ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "incrementUseCount" ) ; }
This method will increment the use count on this order context .
39,604
public synchronized void decrementUseCount ( ) throws SIConnectionDroppedException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "decrementUseCount" ) ; useCount -- ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Use count is now: " + useCount ) ; if ( useCount == 0 ) { close ( ) ; dead = true ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "decrementUseCount" ) ; }
This method will decrement the use count on this order context .
39,605
public void close ( ) throws SIConnectionDroppedException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" ) ; queue = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Returning order context to the order context pool" ) ; final ConnectionProxy cp = getConnectionProxy ( ) ; cp . addOrderContext ( getProxyID ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; }
This method will close the ordering context . This method should ideally be called by the API application . But at present it is called by us when the use count is 0 . The order context is only returned to the connection pool of free order contexts as this avoids an exchange with the server which is costly .
39,606
public void associateWithQueue ( Queue queueToAssociate ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "associateWithQueue" , queueToAssociate ) ; this . queue = queueToAssociate ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "associateWithQueue" ) ; }
Called by a proxy queue to associate itself with this ordering context .
39,607
private String getMessage ( String key , Object ... args ) { String message = messages . getString ( key ) ; return ( args . length == 0 ) ? message : MessageFormat . format ( message , args ) ; }
Get a formatted message .
39,608
private final JsMessage restoreJsMessage ( byte [ ] buffer , Object store ) throws MessageRestoreFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "restoreJsMessage" , buffer ) ; JsMessage newMsg = null ; String className ; int offset = 0 ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Start of buffer: " , SibTr . formatBytes ( buffer , 0 , 256 ) ) ; int temp = ArrayUtil . readInt ( buffer , offset ) ; offset += ArrayUtil . INT_SIZE ; try { className = getClassName ( buffer , offset , temp ) ; } catch ( RuntimeException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.mfp.impl.JsMessageFactoryImpl.restoreJsMessage" , "573" , this , new Object [ ] { MfpConstants . DM_BUFFER , buffer , 0 , buffer . length } ) ; throw new MessageRestoreFailedException ( e ) ; } offset += temp ; offset = ensureSchemasAvailable ( buffer , offset , store ) ; try { JsMsgObject newJmo = new JsMsgObject ( JsHdrAccess . schema , JsPayloadAccess . schema , buffer , offset , buffer . length - offset ) ; Class msgClass = Class . forName ( className ) ; newMsg = ( JsMessage ) msgClass . newInstance ( ) ; ( ( JsMessageImpl ) newMsg ) . setJmo ( newJmo ) ; ( ( JsMessageImpl ) newMsg ) . setApproximateLength ( newJmo . getOriginalLength ( ) ) ; } catch ( ClassNotFoundException e1 ) { FFDCFilter . processException ( e1 , "com.ibm.ws.sib.mfp.impl.JsMessageFactoryImpl.restore" , "534" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Exception " + e1 . toString ( ) + " finding class " + className ) ; throw new MessageRestoreFailedException ( e1 ) ; } catch ( MessageDecodeFailedException e2 ) { throw new MessageRestoreFailedException ( e2 ) ; } catch ( Exception e3 ) { FFDCFilter . processException ( e3 , "com.ibm.ws.sib.mfp.impl.JsMessageFactoryImpl.restore" , "545" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Exception " + e3 . toString ( ) + " instantiating class " + className ) ; throw new MessageRestoreFailedException ( e3 ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "restoreJsMessage" ) ; return newMsg ; }
Restore a JsMessage of any specializaton from a flattenned copy . Since SIB0112b this method is only called by the preceding restoreJsMessage method so it is marked private .
39,609
private final static int ensureSchemasAvailable ( byte [ ] buffer , int offset , Object store ) throws MessageRestoreFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "ensureSchemasAvailable" , new Object [ ] { offset , store } ) ; int temp = ArrayUtil . readInt ( buffer , offset ) ; offset += ArrayUtil . INT_SIZE ; long [ ] decodeIds = new long [ temp ] ; for ( int i = 0 ; i < temp ; i ++ ) { decodeIds [ i ] = ArrayUtil . readLong ( buffer , offset ) ; offset += ArrayUtil . LONG_SIZE ; } if ( store != null && decodeIds . length > 0 ) { if ( ! ( store instanceof MessageStore ) ) throw new IllegalArgumentException ( "store is not a MessageStore instance" ) ; SchemaStore . loadSchemas ( ( MessageStore ) store , decodeIds ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "ensureSchemasAvailable" , offset ) ; return offset ; }
Utility method to extract the schema ids from a message buffer and if a message store is supplied check that all the necessary schemas are available .
39,610
private final JsMessage createSpecialisedMessage ( JsMsgObject jmo ) { JsMessage message = null ; if ( jmo . getChoiceField ( JsHdrAccess . API ) == JsHdrAccess . IS_API_DATA ) { if ( jmo . getField ( JsHdrAccess . MESSAGETYPE ) . equals ( MessageType . JMS . toByte ( ) ) ) { message = getJmsFactory ( ) . createInboundJmsMessage ( jmo , ( ( Byte ) jmo . getField ( JsHdrAccess . SUBTYPE ) ) . intValue ( ) ) ; } } else { message = new JsMessageImpl ( jmo ) ; } return message ; }
Returns a new JsMessage instance of the subclass appropriate to the message content .
39,611
private int bytesToInt ( byte [ ] bytes ) { int result = - 1 ; if ( bytes . length >= 4 ) { result = ( ( bytes [ 0 ] & 0xff ) << 24 ) + ( ( bytes [ 1 ] & 0xff ) << 16 ) + ( ( bytes [ 2 ] & 0xff ) << 8 ) + ( bytes [ 3 ] & 0xff ) ; } return result ; }
A helper function which extracts an int from a byte array representation
39,612
private String getTopic ( ServiceEvent serviceEvent ) { StringBuilder topic = new StringBuilder ( SERVICE_EVENT_TOPIC_PREFIX ) ; switch ( serviceEvent . getType ( ) ) { case ServiceEvent . REGISTERED : topic . append ( "REGISTERED" ) ; break ; case ServiceEvent . MODIFIED : topic . append ( "MODIFIED" ) ; break ; case ServiceEvent . UNREGISTERING : topic . append ( "UNREGISTERING" ) ; break ; default : return null ; } return topic . toString ( ) ; }
Determine the appropriate topic to use for the Service Event .
39,613
public synchronized void updateFilters ( NotificationFilter [ ] filtersArray ) { filters . clear ( ) ; if ( filtersArray != null ) Collections . addAll ( filters , filtersArray ) ; }
Override the list of filters with given array .
39,614
public synchronized boolean isNotificationEnabled ( Notification notification ) { if ( filters . isEmpty ( ) ) { return true ; } final Iterator < NotificationFilter > i = filters . iterator ( ) ; while ( i . hasNext ( ) ) { if ( i . next ( ) . isNotificationEnabled ( notification ) ) { return true ; } } return false ; }
Handle notification filtering according to stored filters .
39,615
public Boolean getApplicationExceptionRollback ( Throwable t ) { Class < ? > klass = t . getClass ( ) ; ApplicationException ae = getApplicationException ( klass ) ; Boolean rollback = null ; if ( ae != null ) { rollback = ae . rollback ( ) ; } else if ( ! ContainerProperties . EE5Compatibility ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "searching for inherited application exception for " + klass . getName ( ) ) ; } for ( Class < ? > superClass = klass . getSuperclass ( ) ; superClass != Throwable . class ; superClass = superClass . getSuperclass ( ) ) { ae = getApplicationException ( superClass ) ; if ( ae != null ) { if ( ae . inherited ( ) ) { rollback = ae . rollback ( ) ; } break ; } } } return rollback ; }
Gets the application exception and rollback status of the specified exception .
39,616
private ApplicationException getApplicationException ( Class < ? > klass ) { ApplicationException result = null ; if ( ivApplicationExceptionMap != null ) { result = ivApplicationExceptionMap . get ( klass . getName ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) && result != null ) { Tr . debug ( tc , "found application-exception for " + klass . getName ( ) + ", rollback=" + result . rollback ( ) + ", inherited=" + result . inherited ( ) ) ; } } if ( result == null ) { result = klass . getAnnotation ( ApplicationException . class ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) && result != null ) { Tr . debug ( tc , "found ApplicationException for " + klass . getName ( ) + ", rollback=" + result . rollback ( ) + ", inherited=" + result . inherited ( ) ) ; } } return result ; }
Gets the application exception status of the specified exception class from either the deployment descriptor or from the annotation .
39,617
public ComponentMetaData [ ] getComponentMetaDatas ( ) { ComponentMetaData [ ] initializedComponentMetaDatas = null ; synchronized ( ivEJBApplicationMetaData ) { initializedComponentMetaDatas = new ComponentMetaData [ ivNumFullyInitializedBeans ] ; int i = 0 ; for ( BeanMetaData bmd : ivBeanMetaDatas . values ( ) ) { if ( bmd . fullyInitialized ) { initializedComponentMetaDatas [ i ++ ] = bmd ; } } } return initializedComponentMetaDatas ; }
Return an Array of fully initialized ComponentMetaDatas for this modules .
39,618
public String toDumpString ( ) { String newLine = AccessController . doPrivileged ( new SystemGetPropertyPrivileged ( "line.separator" , "\n" ) ) ; StringBuilder sb = new StringBuilder ( toString ( ) ) ; String indent = " " ; sb . append ( newLine + newLine + "--- Dump EJBModuleMetaDataImpl fields ---" ) ; if ( ivName != null ) { sb . append ( newLine + indent + "Module name = " + ivName ) ; } else { sb . append ( newLine + indent + "Module name = null" ) ; } if ( ivLogicalName != null ) { sb . append ( newLine + indent + "Module logical name = " + ivLogicalName ) ; } else { sb . append ( newLine + indent + "Module logical name = null" ) ; } sb . append ( newLine + indent + "Module version = " + ivModuleVersion ) ; if ( getApplicationMetaData ( ) != null ) { sb . append ( newLine + indent + "Application metadata = " + getApplicationMetaData ( ) ) ; } else { sb . append ( newLine + indent + "Application metadata = null" ) ; } sb . append ( newLine + indent + "Beans = " + ivBeanMetaDatas . keySet ( ) ) ; if ( ivApplicationExceptionMap != null ) { sb . append ( newLine + indent + "Application Exception map contents:" ) ; for ( Map . Entry < String , ApplicationException > entry : ivApplicationExceptionMap . entrySet ( ) ) { ApplicationException value = entry . getValue ( ) ; sb . append ( newLine + indent + indent + "Exception: " + entry . getKey ( ) + ", rollback = " + value . rollback ( ) + ", inherited = " + value . inherited ( ) ) ; } } else { sb . append ( newLine + indent + "Application Exception map = null" ) ; } sb . append ( newLine + indent + "SFSB failover = " + ivSfsbFailover ) ; if ( ivFailoverInstanceId != null ) { sb . append ( newLine + indent + "Failover instance ID = " + ivFailoverInstanceId ) ; } else { sb . append ( newLine + indent + "Failover instance ID = null" ) ; } sb . append ( newLine + indent + "Fully initialized bean count = " + ivNumFullyInitializedBeans ) ; sb . append ( newLine + indent + "JCDIHelper = " + ivJCDIHelper ) ; sb . append ( newLine + indent + "UseExtendedSetRollbackOnlyBehavior = " + ivUseExtendedSetRollbackOnlyBehavior ) ; sb . append ( newLine + indent + "VersionedBaseName = " + ivVersionedAppBaseName + "#" + ivVersionedModuleBaseName ) ; toString ( sb , newLine , indent ) ; sb . append ( newLine + "--- End EJBModuleMetaDataImpl fields ---" ) ; sb . append ( newLine ) ; return sb . toString ( ) ; }
Return a String with EJB Container s module level runtime config data
39,619
public void addApplicationEventListener ( EJBApplicationEventListener listener ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "addApplicationEventListener: " + listener ) ; if ( ivApplicationEventListeners == null ) { ivApplicationEventListeners = new ArrayList < EJBApplicationEventListener > ( ) ; } ivApplicationEventListeners . add ( listener ) ; }
Adds a new application even listener to be notified when an application has fully started or will begin stopping .
39,620
public void addAutomaticTimerBean ( AutomaticTimerBean timerBean ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "addAutomaticTimerBean: " + timerBean . getBeanMetaData ( ) . j2eeName ) ; if ( ivAutomaticTimerBeans == null ) { ivAutomaticTimerBeans = new ArrayList < AutomaticTimerBean > ( ) ; } ivHasNonPersistentAutomaticTimers |= timerBean . getNumNonPersistentTimers ( ) > 0 ; ivHasPersistentAutomaticTimers |= timerBean . getNumPersistentTimers ( ) > 0 ; ivAutomaticTimerBeans . add ( timerBean ) ; }
Adds a list of timer method metadata for a bean belonging to this application . This method will only be called for beans that contain automatic timers .
39,621
public void freeResourcesAfterAllBeansInitialized ( BeanMetaData bmd ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "freeResourcesAfterAllBeansInitialized: " + bmd . j2eeName + ", " + ( ivNumFullyInitializedBeans + 1 ) + "/" + ivBeanMetaDatas . size ( ) ) ; ivNumFullyInitializedBeans ++ ; boolean freeResources = ivNumFullyInitializedBeans == ivBeanMetaDatas . size ( ) ; if ( freeResources ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "all beans are initialized in module name = " + ivName + ", freeing resources no longer needed" ) ; } ivInterceptorMap = null ; ivInterceptorBindingMap = null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "freeResourcesAfterAllBeansInitialized" ) ; }
d462512 - log orphan warning message .
39,622
public void setVersionedModuleBaseName ( String appBaseName , String modBaseName ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "ModuleName = " + ivName + ", VersionedBaseName = " + appBaseName + "#" + modBaseName ) ; if ( ivInitData == null ) { throw new IllegalStateException ( "ModuleMetaData has finished creation." ) ; } if ( appBaseName == null ) { throw new IllegalArgumentException ( "appBaseName is null" ) ; } if ( modBaseName == null ) { throw new IllegalArgumentException ( "modBaseName is null" ) ; } ivEJBApplicationMetaData . validateVersionedModuleBaseName ( appBaseName , modBaseName ) ; ivVersionedAppBaseName = appBaseName ; ivVersionedModuleBaseName = modBaseName ; }
F54184 F54184 . 2
39,623
private void addElement ( String value ) { if ( null == value ) { return ; } this . num_items ++ ; this . genericValues . add ( value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "addElement: " + value + " num: " + this . num_items ) ; } }
Add the given element to the generic no - key storage . The value must be in lowercase form by the time of this call .
39,624
private void addElement ( String key , String value ) { this . num_items ++ ; List < String > vals = this . values . get ( key ) ; if ( null == vals ) { vals = new LinkedList < String > ( ) ; } if ( null == value ) { vals . add ( "\"\"" ) ; } else { vals . add ( value ) ; } this . values . put ( key , vals ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "addElement: " + key + "=" + value + " num: " + this . num_items ) ; } }
Add the given key = value pair into storage . Both key and value must be in lowercase form . If this key already exists then this value will be appended to the existing values .
39,625
private void parse ( String input ) { char [ ] data = input . toCharArray ( ) ; int start = 0 ; int hard_stop = data . length - 1 ; while ( start < data . length ) { if ( this . mySep == data [ start ] ) { start ++ ; continue ; } int end = start ; String key = null ; boolean insideQuotes = false ; while ( end < data . length ) { boolean extract = false ; if ( '"' == data [ end ] ) { insideQuotes = ! insideQuotes ; } else if ( this . mySep == data [ end ] ) { extract = true ; end -- ; } else if ( '=' == data [ end ] ) { key = extractString ( data , start , end - 1 ) ; end ++ ; start = end ; continue ; } if ( end == hard_stop ) { extract = true ; } if ( extract ) { String value = extractString ( data , start , end ) ; if ( null == key ) { addElement ( value ) ; } else { addElement ( key , value ) ; } end = end + 2 ; start = end ; if ( ! insideQuotes ) { break ; } continue ; } end ++ ; } } }
Parse the input string for all value possibilities .
39,626
private String extractString ( char [ ] data , int start , int end ) { while ( start < end && ( ' ' == data [ start ] || '\t' == data [ start ] || '"' == data [ start ] ) ) { start ++ ; } while ( end >= start && ( ' ' == data [ end ] || '\t' == data [ end ] || '"' == data [ end ] ) ) { end -- ; } if ( end < start ) { return null ; } int len = end - start + 1 ; String rc = Normalizer . normalize ( new String ( data , start , len ) , Normalizer . NORMALIZE_LOWER ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "extractString: [" + rc + "]" ) ; } return rc ; }
Extract a string from the input array based on the start and end markers . This will strip off any leading and trailing white space or quotes .
39,627
public boolean add ( String inputValue ) { String value = Normalizer . normalize ( inputValue , Normalizer . NORMALIZE_LOWER ) ; if ( ! contains ( this . genericValues , value ) ) { addElement ( value ) ; return true ; } return false ; }
Add the generic value to this handler with no required key .
39,628
public boolean add ( String inputKey , String inputValue ) { String key = Normalizer . normalize ( inputKey , Normalizer . NORMALIZE_LOWER ) ; String value = Normalizer . normalize ( inputValue , Normalizer . NORMALIZE_LOWER ) ; if ( ! contains ( this . values . get ( key ) , value ) ) { addElement ( key , value ) ; return true ; } return false ; }
Add the given key = value pair to this handler .
39,629
private boolean remove ( List < String > list , String item ) { if ( null != list ) { if ( list . remove ( item ) ) { this . num_items -- ; return true ; } } return false ; }
Remove the given item from the input list if present and update the item counter appropriately .
39,630
public boolean remove ( String inputKey , String inputValue ) { String key = Normalizer . normalize ( inputKey , Normalizer . NORMALIZE_LOWER ) ; String value = Normalizer . normalize ( inputValue , Normalizer . NORMALIZE_LOWER ) ; boolean rc = remove ( this . values . get ( key ) , value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "remove: " + key + "=" + value + " rc=" + rc ) ; } return rc ; }
Remove this specific key = value pair from storage . If this key exists with other values then those will not be touched only the target value .
39,631
public boolean remove ( String inputValue ) { String value = Normalizer . normalize ( inputValue , Normalizer . NORMALIZE_LOWER ) ; boolean rc = remove ( this . genericValues , value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "remove: " + value + " rc=" + rc ) ; } return rc ; }
Remove the target value from the generic no - key storage .
39,632
public int removeKey ( String inputKey ) { String key = Normalizer . normalize ( inputKey , Normalizer . NORMALIZE_LOWER ) ; int num_removed = 0 ; List < String > vals = this . values . remove ( key ) ; if ( null != vals ) { num_removed = vals . size ( ) ; } this . num_items -= num_removed ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "removeKey: key=" + key + " " + num_removed ) ; } return num_removed ; }
Remove an entire key from storage regardless of how many values it may contain .
39,633
private boolean contains ( List < String > list , String item ) { return ( null == list ) ? false : list . contains ( item ) ; }
Query whether the target list contains the item .
39,634
public boolean containsKey ( String inputKey ) { String key = Normalizer . normalize ( inputKey , Normalizer . NORMALIZE_LOWER ) ; List < String > list = this . values . get ( key ) ; boolean rc = ( null == list ) ? false : ! list . isEmpty ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "containsKey: key=" + inputKey + " rc=" + rc ) ; } return rc ; }
Query whether the target key exists with any values in this handler .
39,635
public Iterator < String > getValues ( String inputKey ) { String key = Normalizer . normalize ( inputKey , Normalizer . NORMALIZE_LOWER ) ; List < String > vals = this . values . get ( key ) ; if ( null != vals ) { return vals . iterator ( ) ; } return new LinkedList < String > ( ) . iterator ( ) ; }
Access an iterator of all values for the target key .
39,636
public String marshall ( ) { if ( 0 == this . num_items ) { return "" ; } boolean shouldPrepend = false ; StringBuilder output = new StringBuilder ( 10 * this . num_items ) ; Iterator < String > i = this . genericValues . iterator ( ) ; while ( i . hasNext ( ) ) { if ( shouldPrepend ) { output . append ( this . mySep ) ; output . append ( ' ' ) ; } output . append ( i . next ( ) ) ; shouldPrepend = true ; } i = this . values . keySet ( ) . iterator ( ) ; while ( i . hasNext ( ) ) { String key = i . next ( ) ; List < String > vals = this . values . get ( key ) ; if ( null == vals ) continue ; int size = vals . size ( ) ; if ( 0 == size ) { continue ; } if ( shouldPrepend ) { output . append ( this . mySep ) ; output . append ( ' ' ) ; } output . append ( key ) ; output . append ( '=' ) ; if ( 1 == size ) { output . append ( vals . get ( 0 ) ) ; } else { shouldPrepend = false ; output . append ( '"' ) ; for ( int count = 0 ; count < size ; count ++ ) { if ( shouldPrepend ) { output . append ( this . mySep ) ; output . append ( ' ' ) ; } output . append ( vals . get ( count ) ) ; shouldPrepend = true ; } output . append ( '"' ) ; } shouldPrepend = true ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "marshalling [" + output . toString ( ) + "]" ) ; } return output . toString ( ) ; }
Take the current data in this handler and create the properly formatted string that would represent the header .
39,637
public void clear ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Clearing this header handler: " + this ) ; } this . num_items = 0 ; this . values . clear ( ) ; this . genericValues . clear ( ) ; }
Clear everything out of storage for this handler .
39,638
protected void proddle ( ) throws SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "proddle" ) ; boolean useThisThread = false ; synchronized ( priorityQueue ) { synchronized ( this ) { if ( idle ) { useThisThread = isWorkAvailable ( ) ; idle = ! useThisThread ; } } } if ( useThisThread ) { doWork ( false ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "proddle" ) ; }
being F176003 F181603 . 2 D192359
39,639
public void complete ( NetworkConnection vc , IOWriteRequestContext wctx ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "complete" , new Object [ ] { vc , wctx } ) ; if ( connection . isLoggingIOEvents ( ) ) connection . getConnectionEventRecorder ( ) . logDebug ( "complete method invoked on write context " + System . identityHashCode ( wctx ) ) ; try { doWork ( true ) ; } catch ( SIConnectionDroppedException connectionDroppedException ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Caught SIConnectionDroppedException, Priority Queue has been purged" ) ; } catch ( Error error ) { FFDCFilter . processException ( error , "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback" , JFapChannelConstants . CONNWRITECOMPCALLBACK_COMPLETE_03 , connection . getDiagnostics ( true ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( this , tc , error ) ; connection . invalidate ( false , error , "Error caught in ConnectionWriteCompletedCallback.complete()" ) ; throw error ; } catch ( RuntimeException runtimeException ) { FFDCFilter . processException ( runtimeException , "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback" , JFapChannelConstants . CONNWRITECOMPCALLBACK_COMPLETE_04 , connection . getDiagnostics ( true ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( this , tc , runtimeException ) ; connection . invalidate ( false , runtimeException , "RuntimeException caught in ConnectionWriteCompletedCallback.complete()" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "complete" ) ; }
begin F181603 . 2 D192359
39,640
private void doWork ( boolean hasWritten ) throws SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "doWork" , Boolean . valueOf ( hasWritten ) ) ; final BlockingQueue < Pair < SendListener , Conversation > > readySendCallbacks = new LinkedBlockingQueue < Pair < SendListener , Conversation > > ( ) ; boolean hasGoneAsync = false ; do { boolean hasMoreWork ; do { if ( hasWritten ) { sendCallbacks . drainTo ( readySendCallbacks ) ; } hasWritten = false ; hasMoreWork = false ; synchronized ( priorityQueue ) { synchronized ( this ) { if ( ! isWorkAvailable ( ) ) break ; } } final WsByteBuffer writeBuffer = getWriteContextBuffer ( ) ; writeBuffer . clear ( ) ; if ( dequeueTransmissionData ( writeBuffer ) ) { synchronized ( connectionClosedLock ) { if ( ! connectionClosed ) { writeBuffer . flip ( ) ; if ( connection . isLoggingIOEvents ( ) ) connection . getConnectionEventRecorder ( ) . logDebug ( "invoking writeCtx.write() on context " + System . identityHashCode ( writeCtx ) + " to write all data with no timeout" ) ; final NetworkConnection vc = writeCtx . write ( IOWriteRequestContext . WRITE_ALL_DATA , this , false , IOWriteRequestContext . NO_TIMEOUT ) ; hasGoneAsync = ( vc == null ) ; hasWritten = true ; hasMoreWork = ! hasGoneAsync ; } } } } while ( hasMoreWork ) ; } while ( ! hasGoneAsync && ! switchToIdle ( ) ) ; notifyReadySendListeners ( readySendCallbacks ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "doWork" ) ; }
Looks to initiate write operations to write all available data from the priority queue to the network . Continues until all data has been sent or until the return from a write call indicates its completion will be asynchronous . Once it has finished writing on this thread calls the registered send listeners for all messages that have been completely sent .
39,641
private void notifyReadySendListeners ( BlockingQueue < Pair < SendListener , Conversation > > readySendCallbacks ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "notifyReadySendListeners" , readySendCallbacks ) ; try { for ( Pair < SendListener , Conversation > callback : readySendCallbacks ) { callback . left . dataSent ( callback . right ) ; } } catch ( Throwable t ) { FFDCFilter . processException ( t , "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback" , JFapChannelConstants . CONNWRITECOMPCALLBACK_COMPLETE_01 , connection . getDiagnostics ( true ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "exception invoking send listener data sent" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( tc , t ) ; connection . invalidate ( true , t , "send listener threw exception" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "notifyReadySendListeners" ) ; }
Call send listener callback for each entry in the given queue . Any exception thrown from a listener s callback will cause the connection to be invalidated .
39,642
private boolean switchToIdle ( ) throws SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "switchToIdle" ) ; final boolean noMoreWork ; synchronized ( priorityQueue ) { synchronized ( this ) { noMoreWork = ! isWorkAvailable ( ) ; idle = noMoreWork ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "switchToIdle" , Boolean . valueOf ( noMoreWork ) ) ; return noMoreWork ; }
Switch the idle flag back to true provided that there is no work available .
39,643
private WsByteBuffer getWriteContextBuffer ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getWriteContextBuffer" ) ; WsByteBuffer writeBuffer = getSoleWriteContextBuffer ( ) ; if ( firstInvocation . compareAndSet ( true , false ) || ( writeBuffer == null ) ) { final int writeBufferSize = Integer . parseInt ( RuntimeInfo . getProperty ( "com.ibm.ws.sib.jfapchannel.DEFAULT_WRITE_BUFFER_SIZE" , "" + JFapChannelConstants . DEFAULT_WRITE_BUFFER_SIZE ) ) ; if ( ( writeBuffer != null ) && ( ! writeBuffer . isDirect ( ) || writeBuffer . capacity ( ) < writeBufferSize ) ) { writeBuffer . release ( ) ; writeBuffer = null ; } if ( writeBuffer == null ) { writeBuffer = WsByteBufferPool . getInstance ( ) . allocateDirect ( writeBufferSize ) ; writeCtx . setBuffer ( writeBuffer ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getWriteContextBuffer" , writeBuffer ) ; return writeBuffer ; }
Returns the single WsByteBuffer set in writeCtx ensuring that it is a direct byte buffer and is of sufficient capacity .
39,644
private WsByteBuffer getSoleWriteContextBuffer ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSoleWriteContextBuffer" ) ; WsByteBuffer writeBuffer = null ; final WsByteBuffer [ ] writeBuffers = writeCtx . getBuffers ( ) ; if ( writeBuffers != null ) { final int writeBuffersSize = writeBuffers . length ; if ( writeBuffersSize > 0 ) { writeBuffer = writeBuffers [ 0 ] ; if ( writeBuffersSize > 1 ) { writeCtx . setBuffer ( writeBuffer ) ; for ( int i = 1 ; i < writeBuffersSize ; i ++ ) { if ( writeBuffers [ i ] != null ) writeBuffers [ i ] . release ( ) ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getSoleWriteContextBuffer" , writeBuffer ) ; return writeBuffer ; }
Returns the first WsByteBuffer set in writeCtx ensuring that it is the sole byte buffer set in writeCtx and releasing any other byte buffers that had been registered there .
39,645
protected void physicalCloseNotification ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "physicalCloseNotification" ) ; synchronized ( connectionClosedLock ) { connectionClosed = true ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "physicalCloseNotification" ) ; }
Register notification that the physical underlying connection has been closed .
39,646
private boolean isWorkAvailable ( ) throws SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isWorkAvailable" ) ; final boolean isWork ; if ( terminate ) { isWork = false ; } else { isWork = ( partiallySentTransmission != null ) || ! priorityQueue . isEmpty ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isWorkAvailable" , Boolean . valueOf ( isWork ) ) ; return isWork ; }
Returns true iff there is more work available to be processed .
39,647
public static boolean addWarToServer ( LibertyServer targetServer , String targetDir , String warName , String [ ] warPackageNames , boolean addWarResources ) throws Exception { String earName = null ; boolean addEarResources = DO_NOT_ADD_RESOURCES ; String jarName = null ; boolean addJarResources = DO_NOT_ADD_RESOURCES ; String [ ] jarPackageNames = null ; return addToServer ( targetServer , targetDir , earName , addEarResources , warName , warPackageNames , addWarResources , jarName , jarPackageNames , addJarResources ) ; }
Package a WAR and add it to a server .
39,648
public static boolean addToServer ( LibertyServer targetServer , String targetDir , String earName , boolean addEarResources , String warName , String [ ] warPackageNames , boolean addWarResources , String jarName , String [ ] jarPackageNames , boolean addJarResources ) throws Exception { if ( warName == null ) { throw new IllegalArgumentException ( "A war name must be specified." ) ; } if ( targetServer . isStarted ( ) ) { String appName = warName . substring ( 0 , warName . indexOf ( ".war" ) ) ; if ( ! targetServer . getInstalledAppNames ( appName ) . isEmpty ( ) ) { return false ; } } JavaArchive jar ; if ( jarName == null ) { jar = null ; } else { jar = createJar ( jarName , jarPackageNames , addJarResources ) ; } WebArchive war = createWar ( warName , warPackageNames , addWarResources , jar ) ; EnterpriseArchive ear ; if ( earName == null ) { ear = null ; } else { ear = createEar ( earName , addEarResources , war ) ; } if ( ear != null ) { ShrinkHelper . exportToServer ( targetServer , targetDir , ear ) ; } else { ShrinkHelper . exportToServer ( targetServer , targetDir , war ) ; } return true ; }
Conditionally package a JAR WAR and EAR and add them to a server .
39,649
public boolean couldContainAnnotationsOnClassDef ( DataInput in , Set < String > byteCodeAnnotationsNames ) throws IOException { int magic = in . readInt ( ) ; if ( magic != 0xCAFEBABE ) { return false ; } int minorVersion = in . readUnsignedShort ( ) ; int majorVersion = in . readUnsignedShort ( ) ; if ( majorVersion < 49 ) { return false ; } int constantsPoolCount = in . readUnsignedShort ( ) ; for ( int i = 1 ; i < constantsPoolCount ; i ++ ) { int tag = in . readUnsignedByte ( ) ; switch ( tag ) { case CP_INFO_UTF8 : String name = in . readUTF ( ) ; if ( byteCodeAnnotationsNames . contains ( name ) ) { return true ; } break ; case CP_INFO_CLASS : in . readUnsignedShort ( ) ; break ; case CP_INFO_FIELD_REF : case CP_INFO_METHOD_REF : case CP_INFO_INTERFACE_REF : in . readUnsignedShort ( ) ; in . readUnsignedShort ( ) ; break ; case CP_INFO_STRING : in . readUnsignedShort ( ) ; break ; case CP_INFO_INTEGER : case CP_INFO_FLOAT : in . readInt ( ) ; break ; case CP_INFO_LONG : case CP_INFO_DOUBLE : in . readInt ( ) ; in . readInt ( ) ; i ++ ; break ; case CP_INFO_NAME_AND_TYPE : in . readUnsignedShort ( ) ; in . readUnsignedShort ( ) ; break ; case CP_INFO_METHOD_HANDLE : in . readUnsignedByte ( ) ; in . readUnsignedShort ( ) ; break ; case CP_INFO_METHOD_TYPE : in . readUnsignedShort ( ) ; break ; case CP_INFO_INVOKE_DYNAMIC : in . readUnsignedShort ( ) ; in . readUnsignedShort ( ) ; break ; default : if ( log . isLoggable ( Level . WARNING ) ) { log . warning ( "Unknown tag in constants pool: " + tag ) ; } i = constantsPoolCount ; break ; } } return false ; }
Checks if the . class file referenced by the DataInput could contain the annotation names available in the set .
39,650
public Properties getProperties ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getProperties" ) ; return this . sslProperties ; }
Access the current properties for this context .
39,651
public void setProperties ( Properties sslProps ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setProperties" ) ; this . sslProperties = sslProps ; }
Set the properties for this thread context .
39,652
public boolean getSetSignerOnThread ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getSetSignerOnThread: " + this . setSignerOnThread ) ; return this . setSignerOnThread ; }
Query whether the signer flag is set on this context .
39,653
public boolean getAutoAcceptBootstrapSigner ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getAutoAcceptBootstrapSigner: " + this . autoAcceptBootstrapSigner ) ; return this . autoAcceptBootstrapSigner ; }
Query whether the autoaccept bootstrap signer flag is set on this context .
39,654
public Map < String , Object > getInboundConnectionInfo ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getInboundConnectionInfo" ) ; return this . inboundConnectionInfo ; }
Access the inbound connection info object for this context .
39,655
public void setAutoAcceptBootstrapSigner ( boolean flag ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setAutoAcceptBootstrapSigner -> " + flag ) ; this . autoAcceptBootstrapSigner = flag ; }
Set the autoaccept bootstrap signer flag on this context to the input value .
39,656
public boolean getAutoAcceptBootstrapSignerWithoutStorage ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getAutoAcceptBootstrapSignerWithoutStorage: " + this . autoAcceptBootstrapSignerWithoutStorage ) ; return this . autoAcceptBootstrapSignerWithoutStorage ; }
Query whether the autoaccept bootstrap signer without storage flag is set on this context .
39,657
public void setAutoAcceptBootstrapSignerWithoutStorage ( boolean flag ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setAutoAcceptBootstrapSignerWithoutStorage -> " + flag ) ; this . autoAcceptBootstrapSignerWithoutStorage = flag ; }
Set the autoaccept bootstrap signer without storage flag to the input value .
39,658
public void setSetSignerOnThread ( boolean flag ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setSetSignerOnThread: " + flag ) ; this . setSignerOnThread = flag ; }
Set the signer flag on this context to the input value .
39,659
public X509Certificate [ ] getSignerChain ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getSignerChain" ) ; return signer == null ? null : signer . clone ( ) ; }
Query the signer chain set on this context .
39,660
public void setSignerChain ( X509Certificate [ ] signerChain ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setSignerChain" ) ; this . signer = signerChain == null ? null : signerChain . clone ( ) ; }
Set the signer chain on this context to the input value .
39,661
public void setInboundConnectionInfo ( Map < String , Object > connectionInfo ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setInboundConnectionInfo" ) ; this . inboundConnectionInfo = connectionInfo ; }
Set the inbound connection info on this context to the input value .
39,662
public Map < String , Object > getOutboundConnectionInfo ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getOutboundConnectionInfo" ) ; return this . outboundConnectionInfo ; }
Query the outbound connection info map of this context .
39,663
public void setOutboundConnectionInfo ( Map < String , Object > connectionInfo ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setOutboundConnectionInfo" ) ; this . outboundConnectionInfo = connectionInfo ; }
Set the outbound connection info of this context to the input value .
39,664
public Map < String , Object > getOutboundConnectionInfoInternal ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getOutboundConnectionInfoInternal" ) ; return this . outboundConnectionInfoInternal ; }
Get the internal outbound connection info object for this context .
39,665
public void setOutboundConnectionInfoInternal ( Map < String , Object > connectionInfo ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setOutboundConnectionInfoInternal :" + connectionInfo ) ; this . outboundConnectionInfoInternal = connectionInfo ; }
Set the internal outbound connection info object for this context .
39,666
protected byte [ ] serializeObject ( Serializable theObject ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; ObjectOutputStream oout = new ObjectOutputStream ( baos ) ; oout . writeObject ( theObject ) ; byte [ ] data = baos . toByteArray ( ) ; baos . close ( ) ; oout . close ( ) ; return data ; }
This method is used to serialized an object saved into a table BLOB field .
39,667
public void setPuName ( String puName ) { if ( ivPuName == null || ivPuName . length ( ) == 0 ) { ivPuName = puName ; reComputeHashCode ( ) ; } }
Persistence unit name setter .
39,668
private void reComputeHashCode ( ) { ivCurHashCode = ( ivAppName != null ? ivAppName . hashCode ( ) : 0 ) + ( ivModJarName != null ? ivModJarName . hashCode ( ) : 0 ) + ( ivPuName != null ? ivPuName . hashCode ( ) : 0 ) ; }
Compute and cache the current hashCode .
39,669
public ChildChannelDataImpl createChild ( ) { String childName = this . name + CHILD_STRING + nextChildId ( ) ; ChildChannelDataImpl child = new ChildChannelDataImpl ( childName , this ) ; this . children . add ( child ) ; return child ; }
Create a child data object . Add it to the list of children and return it .
39,670
private static ReadableLogRecord read ( ByteBuffer viewBuffer , long expectedSequenceNumber , ByteBuffer sourceBuffer ) { ReadableLogRecord logRecord = null ; int absolutePosition = sourceBuffer . position ( ) + viewBuffer . position ( ) ; final byte [ ] magicNumberBuffer = new byte [ RECORD_MAGIC_NUMBER . length ] ; viewBuffer . get ( magicNumberBuffer ) ; int recordLength = 0 ; if ( Arrays . equals ( magicNumberBuffer , RECORD_MAGIC_NUMBER ) ) { long recordSequenceNumber = viewBuffer . getLong ( ) ; if ( recordSequenceNumber >= expectedSequenceNumber ) { recordLength = viewBuffer . getInt ( ) ; final int recordDataPosition = viewBuffer . position ( ) ; viewBuffer . position ( recordDataPosition + recordLength ) ; final long tailSequenceNumber = viewBuffer . getLong ( ) ; if ( tailSequenceNumber == recordSequenceNumber ) { viewBuffer . position ( recordDataPosition ) ; logRecord = new ReadableLogRecord ( viewBuffer , absolutePosition , tailSequenceNumber ) ; sourceBuffer . position ( absolutePosition + HEADER_SIZE + recordLength ) ; } } } return logRecord ; }
careful with trace in this method as it is called many times from doByteByByteScanning
39,671
private static ReadableLogRecord doByteByByteScanning ( ByteBuffer sourceBuffer , long expectedSequenceNumber ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "doByteByByteScanning" , new Object [ ] { sourceBuffer , new Long ( expectedSequenceNumber ) } ) ; ReadableLogRecord logRecord = null ; ByteBuffer viewBuffer = sourceBuffer . slice ( ) ; for ( int position = LogRecord . HEADER_SIZE ; position + LogRecord . HEADER_SIZE < viewBuffer . limit ( ) ; position ++ ) { viewBuffer . position ( position ) ; byte peak = viewBuffer . get ( position ) ; if ( peak == 82 ) { peak = viewBuffer . get ( position + 1 ) ; if ( peak == 67 ) { try { logRecord = read ( viewBuffer , expectedSequenceNumber , sourceBuffer ) ; if ( logRecord != null ) break ; } catch ( RuntimeException e ) { } } } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "doByteByByteScanning" , logRecord ) ; return logRecord ; }
careful with trace in this methods loop
39,672
public synchronized boolean add ( String key , T value ) { if ( key . length ( ) > 3 && key . endsWith ( WILDCARD ) && key . charAt ( key . length ( ) - 2 ) != '.' ) { throw new IllegalArgumentException ( "Unsupported use of wildcard in key " + key ) ; } Node < T > current = internalFind ( key , false ) ; if ( current . getValue ( ) != null ) return false ; current . setValue ( value ) ; return true ; }
Add a new value using the given key .
39,673
public void compact ( ) { for ( NodeIterator < T > i = this . getNodeIterator ( ) ; i . hasNext ( ) ; ) { NodeIndex < T > n = i . next ( ) ; if ( n . node . exactKids != null ) n . node . exactKids . trimToSize ( ) ; } }
Compact any empty space after a read - only trie has been constructed
39,674
public String dump ( ) { StringBuilder s = new StringBuilder ( ) ; int c = 0 ; s . append ( nl ) ; for ( NodeIterator < T > i = this . getNodeIterator ( null ) ; i . hasNext ( ) ; ) { NodeIndex < T > n = i . next ( ) ; c ++ ; s . append ( '\t' ) . append ( n . pkg ) . append ( " = " ) . append ( n . node . getValue ( ) ) . append ( nl ) ; } s . append ( "\t- ) . append ( c ) . append ( " elements" ) ; return s . toString ( ) ; }
Debugging during test dump for FFDC
39,675
NodeIterator < T > getNodeIterator ( Filter < T > filter ) { return new NodeIterator < T > ( root , filter , true ) ; }
Get an internal iterator for nodes that allows filtering based on packages or values .
39,676
public void modifed ( ServiceReference < ResourceFactory > ref ) { String [ ] newInterfaces = getServiceInterfaces ( ref ) ; if ( ! Arrays . equals ( interfaces , newInterfaces ) ) { unregister ( ) ; register ( ref , newInterfaces ) ; } else { registration . setProperties ( getServiceProperties ( ref ) ) ; } }
Notification that the properties for the ResourceFactory changed .
39,677
public List < PersistenceProvider > getPersistenceProviders ( ) { ClassLoader cl = PrivClassLoader . get ( null ) ; if ( cl == null ) { cl = PrivClassLoader . get ( HybridPersistenceActivator . class ) ; } List < PersistenceProvider > nonOSGiProviders = providerCache . get ( cl ) ; if ( nonOSGiProviders == null ) { nonOSGiProviders = new ArrayList < PersistenceProvider > ( ) ; try { List < Object > providers = ProviderLocator . getServices ( PersistenceProvider . class . getName ( ) , getClass ( ) , cl ) ; for ( Iterator < Object > provider = providers . iterator ( ) ; provider . hasNext ( ) ; ) { Object o = provider . next ( ) ; if ( o instanceof PersistenceProvider ) { nonOSGiProviders . add ( ( PersistenceProvider ) o ) ; } } providerCache . put ( cl , nonOSGiProviders ) ; } catch ( Exception e ) { throw new PersistenceException ( "Failed to load provider from META-INF/services" , e ) ; } } List < PersistenceProvider > combinedProviders = new ArrayList < PersistenceProvider > ( nonOSGiProviders ) ; combinedProviders . addAll ( super . getPersistenceProviders ( ) ) ; return combinedProviders ; }
This method returns a combination of those persistence providers available from the application classloader in addition to those in the OSGi service registry . OSGi providers are not cached and should not be cached because bundles can be moved in and out of the system and it is the job of the the service tracker to maintain them .
39,678
public boolean add ( Object o ) { ConnectorProperty connectorPropertyToAdd = ( ConnectorProperty ) o ; String nameToAdd = connectorPropertyToAdd . getName ( ) ; ConnectorProperty connectorProperty = null ; String name = null ; Enumeration < Object > e = this . elements ( ) ; while ( e . hasMoreElements ( ) ) { connectorProperty = ( ConnectorProperty ) e . nextElement ( ) ; name = connectorProperty . getName ( ) ; if ( name . equals ( nameToAdd ) ) { if ( tc . isDebugEnabled ( ) ) { String value = ( String ) connectorPropertyToAdd . getValue ( ) ; if ( ! value . equals ( "" ) ) { if ( name . equals ( "UserName" ) || name . equals ( "Password" ) ) { Tr . debug ( tc , "DUPLICATE_USERNAME_PASSWORD_CONNECTOR_PROPERTY_J2CA0103" , new Object [ ] { ( ConnectorProperty ) o } ) ; } else { Tr . warning ( tc , "DUPLICATE_CONNECTOR_PROPERTY_J2CA0308" , new Object [ ] { ( ConnectorProperty ) o } ) ; } } } return true ; } } return super . add ( o ) ; }
override the Vector add method to not add duplicate entries . That is entries with the same name .
39,679
public String findConnectorPropertyString ( String desiredPropertyName , String defaultValue ) { String retVal = defaultValue ; String name = null ; ConnectorProperty property = null ; Enumeration < Object > e = this . elements ( ) ; while ( e . hasMoreElements ( ) ) { property = ( ConnectorProperty ) e . nextElement ( ) ; name = property . getName ( ) ; if ( name . equals ( desiredPropertyName ) ) { retVal = ( String ) property . getValue ( ) ; } } return retVal ; }
Given this ConnectorProperties Vector find the String identified by the input desiredPropertyName . If not found return the defaultValue .
39,680
public void handleMessage ( MessageItem msgItem ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "handleMessage" , new Object [ ] { msgItem } ) ; JsMessage jsMsg = msgItem . getMessage ( ) ; int priority = jsMsg . getPriority ( ) . intValue ( ) ; Reliability reliability = jsMsg . getReliability ( ) ; StreamSet streamSet = getStreamSetForMessage ( jsMsg ) ; if ( streamSet == null ) { handleNewStreamID ( msgItem ) ; } else { TargetStream targetStream = null ; synchronized ( streamSet ) { targetStream = ( TargetStream ) streamSet . getStream ( priority , reliability ) ; if ( targetStream == null ) { targetStream = createStream ( streamSet , priority , reliability , streamSet . getPersistentData ( priority , reliability ) ) ; } } targetStream . writeValue ( msgItem ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "handleMessage" ) ; }
Handle a new message by inserting it in to the appropriate target stream . If the stream ID in the message is a new one a flush query will be sent to the source . If the ID has been seen before but the specific stream is not found a new one will be created and added to the stream set .
39,681
public void handleSilence ( MessageItem msgItem ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "handleSilence" , new Object [ ] { msgItem } ) ; JsMessage jsMsg = msgItem . getMessage ( ) ; int priority = jsMsg . getPriority ( ) . intValue ( ) ; Reliability reliability = jsMsg . getReliability ( ) ; StreamSet streamSet = getStreamSetForMessage ( jsMsg ) ; if ( streamSet != null ) { TargetStream targetStream = null ; synchronized ( streamSet ) { targetStream = ( TargetStream ) streamSet . getStream ( priority , reliability ) ; } if ( targetStream != null ) { targetStream . writeSilence ( msgItem ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "handleSilence" ) ; }
Handle a filtered message by inserting it in to the appropriate target stream as Silence . Since we only need to do this on exisiting TargetStreams if the streamSet or stream are null we give up
39,682
private void handleNewStreamID ( ControlMessage cMsg ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "handleNewStreamID" , new Object [ ] { cMsg } ) ; handleNewStreamID ( cMsg , null ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "handleNewStreamID" ) ; }
Handle a new stream ID from a control message
39,683
private void handleNewStreamID ( AbstractMessage aMessage , MessageItem msgItem ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "handleNewStreamID" , new Object [ ] { aMessage , msgItem } ) ; SIBUuid12 streamID = aMessage . getGuaranteedStreamUUID ( ) ; synchronized ( flushMap ) { FlushQueryRecord entry = flushMap . get ( streamID ) ; if ( ( entry != null ) && ( msgItem != null ) ) { entry . append ( msgItem ) ; } else { SIBUuid8 sourceMEUuid = aMessage . getGuaranteedSourceMessagingEngineUUID ( ) ; SIBUuid12 destID = aMessage . getGuaranteedTargetDestinationDefinitionUUID ( ) ; SIBUuid8 busID = aMessage . getGuaranteedCrossBusSourceBusUUID ( ) ; long reqID = messageProcessor . nextTick ( ) ; entry = new FlushQueryRecord ( sourceMEUuid , destID , busID , msgItem , reqID ) ; flushMap . put ( streamID , entry ) ; upControl . sendAreYouFlushedMessage ( sourceMEUuid , destID , busID , reqID , streamID ) ; entry . resend = am . create ( GDConfig . FLUSH_QUERY_INTERVAL , this , streamID ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "handleNewStreamID" ) ; }
Handle a new stream ID and cache a MessageItem for replay later . msgItem can be null for example if this was triggered by a control message .
39,684
private StreamSet addNewStreamSet ( SIBUuid12 streamID , SIBUuid8 sourceMEUuid , SIBUuid12 remoteDestUuid , SIBUuid8 remoteBusUuid , String linkTarget ) throws SIRollbackException , SIConnectionLostException , SIIncorrectCallException , SIResourceException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addNewStreamSet" , new Object [ ] { streamID , sourceMEUuid , remoteDestUuid , remoteBusUuid , linkTarget } ) ; StreamSet streamSet = null ; try { LocalTransaction tran = txManager . createLocalTransaction ( false ) ; Transaction msTran = txManager . resolveAndEnlistMsgStoreTransaction ( tran ) ; streamSet = new StreamSet ( streamID , sourceMEUuid , remoteDestUuid , remoteBusUuid , protocolItemStream , txManager , 0 , destination . isLink ( ) ? StreamSet . Type . LINK_TARGET : StreamSet . Type . TARGET , tran , linkTarget ) ; protocolItemStream . addItem ( streamSet , msTran ) ; tran . commit ( ) ; synchronized ( streamSets ) { streamSets . put ( streamID , streamSet ) ; sourceMap . put ( streamID , sourceMEUuid ) ; } } catch ( OutOfCacheSpace e ) { SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addNewStreamSet" , e ) ; throw new SIResourceException ( e ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.gd.TargetStreamManager.addNewStreamSet" , "1:471:1.69" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addNewStreamSet" , e ) ; throw new SIResourceException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addNewStreamSet" , streamSet ) ; return streamSet ; }
Create a new StreamSet for a given streamID and sourceCellule .
39,685
private TargetStream createStream ( StreamSet streamSet , int priority , Reliability reliability , long completedPrefix ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createStream" , new Object [ ] { streamSet , Integer . valueOf ( priority ) , reliability , Long . valueOf ( completedPrefix ) } ) ; TargetStream stream = null ; stream = createStream ( streamSet , priority , reliability ) ; stream . setCompletedPrefix ( completedPrefix ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createStream" ) ; return stream ; }
Create a new TargetStream and initialize it with a given completed prefix . Always called with streamSet lock
39,686
private TargetStream createStream ( StreamSet streamSet , int priority , Reliability reliability ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createStream" , new Object [ ] { streamSet , Integer . valueOf ( priority ) , reliability } ) ; TargetStream stream = null ; if ( reliability . compareTo ( Reliability . BEST_EFFORT_NONPERSISTENT ) <= 0 ) { stream = new ExpressTargetStream ( deliverer , streamSet . getRemoteMEUuid ( ) , streamSet . getStreamID ( ) ) ; } else { stream = new GuaranteedTargetStream ( deliverer , upControl , am , streamSet , priority , reliability , new ArrayList ( ) , messageProcessor ) ; } streamSet . setStream ( priority , reliability , stream ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createStream" , stream ) ; return stream ; }
Create a new TargetStream in the given StreamSet
39,687
public void handleFlushedMessage ( ControlFlushed cMsg ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "handleFlushedMessage" , new Object [ ] { cMsg } ) ; SIBUuid12 streamID = cMsg . getGuaranteedStreamUUID ( ) ; forceFlush ( streamID ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "handleFlushedMessage" ) ; }
Handle a ControlFlushed message . Flush any existing streams and throw away any cached messages .
39,688
public void forceFlush ( SIBUuid12 streamID ) throws SIResourceException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "forceFlush" , new Object [ ] { streamID } ) ; synchronized ( flushMap ) { FlushQueryRecord entry = flushMap . remove ( streamID ) ; if ( entry != null ) entry . resend . cancel ( ) ; flush ( streamID ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "forceFlush" ) ; }
Flush any existing streams and throw away any cached messages .
39,689
public void requestFlushAtSource ( SIBUuid8 source , SIBUuid12 destID , SIBUuid8 busID , SIBUuid12 stream , boolean indoubtDiscard ) throws SIException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "requestFlushAtSource" , new Object [ ] { source , stream } ) ; synchronized ( flushMap ) { if ( flushMap . containsKey ( stream ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "requestFlushAtSource" ) ; return ; } long reqID = messageProcessor . nextTick ( ) ; FlushQueryRecord entry = new FlushQueryRecord ( source , destID , busID , reqID ) ; flushMap . put ( stream , entry ) ; upControl . sendRequestFlushMessage ( source , destID , busID , reqID , stream , indoubtDiscard ) ; entry . resend = am . create ( GDConfig . REQUEST_FLUSH_INTERVAL , this , stream ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "requestFlushAtSource" ) ; }
Send a request to flush a stream . The originator of the stream and the ID for the stream must be known . This method is public because it s not clear who s going to call this yet .
39,690
public void handleSilenceMessage ( ControlSilence cMsg ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "handleSilenceMessage" , new Object [ ] { cMsg } ) ; int priority = cMsg . getPriority ( ) . intValue ( ) ; Reliability reliability = cMsg . getReliability ( ) ; SIBUuid12 streamID = cMsg . getGuaranteedStreamUUID ( ) ; StreamSet streamSet = getStreamSetForMessage ( cMsg ) ; if ( streamSet == null ) { handleNewStreamID ( cMsg ) ; } else { TargetStream targetStream = null ; synchronized ( streamSet ) { targetStream = ( TargetStream ) streamSet . getStream ( priority , reliability ) ; if ( targetStream == null ) { targetStream = createStream ( streamSet , priority , reliability , streamSet . getPersistentData ( priority , reliability ) ) ; } } targetStream . writeSilence ( cMsg ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "handleSilenceMessage" ) ; }
Handle a ControlSilence message .
39,691
public void reconstituteStreamSet ( StreamSet streamSet ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reconstituteStreamSet" , streamSet ) ; synchronized ( streamSets ) { streamSets . put ( streamSet . getStreamID ( ) , streamSet ) ; sourceMap . put ( streamSet . getStreamID ( ) , streamSet . getRemoteMEUuid ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstituteStreamSet" ) ; }
Restore a StreamSet to a previous state
39,692
public void alarm ( Object alarmContext ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "alarm" , alarmContext ) ; SIBUuid12 sid = ( SIBUuid12 ) alarmContext ; synchronized ( flushMap ) { FlushQueryRecord entry = flushMap . get ( sid ) ; if ( entry != null ) { entry . attempts -- ; if ( entry . attempts > 0 ) { try { if ( entry . cache == null ) { upControl . sendRequestFlushMessage ( entry . source , entry . destId , entry . busId , entry . requestID , sid , false ) ; } else { upControl . sendAreYouFlushedMessage ( entry . source , entry . destId , entry . busId , entry . requestID , sid ) ; } } catch ( SIResourceException e ) { flushMap . remove ( sid ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( tc , "Flush query failed for stream: " + sid ) ; } } else { flushMap . remove ( sid ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( tc , "Flush query expired for stream: " + sid ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "alarm" ) ; }
This method is called when an alarm expires for an are you flushed or flush request query .
39,693
public boolean isEmpty ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "isEmpty" ) ; SibTr . exit ( tc , "isEmpty" , new Object [ ] { Boolean . valueOf ( streamSets . isEmpty ( ) ) , Boolean . valueOf ( flushedStreamSets . isEmpty ( ) ) , streamSets , this } ) ; } return ( streamSets . isEmpty ( ) && flushedStreamSets . isEmpty ( ) ) ; }
Determine if there are any unflushed target streams to the destination
39,694
public void queryUnflushedStreams ( ) throws SIResourceException { synchronized ( streamSets ) { for ( Iterator i = streamSets . iterator ( ) ; i . hasNext ( ) ; ) { StreamSet next = ( StreamSet ) i . next ( ) ; upControl . sendAreYouFlushedMessage ( next . getRemoteMEUuid ( ) , next . getDestUuid ( ) , next . getBusUuid ( ) , - 1 , next . getStreamID ( ) ) ; } } }
Sends an are you flushed query to the source of any unflushed streams . We use this to determine when it s safe to delete a destination with possibly indoubt messages .
39,695
private boolean validateAutomaticTimer ( BeanMetaData bmd ) { if ( bmd . timedMethodInfos == null || methodId > bmd . timedMethodInfos . length ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "validateAutomaticTimer: ivMethodId=" + methodId + " > " + Arrays . toString ( bmd . timedMethodInfos ) ) ; return false ; } Method method = bmd . timedMethodInfos [ methodId ] . ivMethod ; if ( ! method . getName ( ) . equals ( automaticMethodName ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "validateAutomaticTimer: ivAutomaticMethodName=" + automaticMethodName + " != " + method . getName ( ) ) ; return false ; } if ( automaticClassName != null && ! automaticClassName . equals ( method . getDeclaringClass ( ) . getName ( ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "validateAutomaticTimer: ivAutomaticClassName=" + automaticClassName + " != " + method . getDeclaringClass ( ) . getName ( ) ) ; return false ; } return true ; }
Validate that the method corresponding to the method ID stored in the database matches the method that was used when the automatic timer was created . For example this validation will fail if the application is changed to remove an automatic timer without clearing the timers from the database . As a prerequisite to calling this method this object must be an automatic timer .
39,696
private void writeObject ( ObjectOutputStream out ) throws IOException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "writeObject: " + this ) ; int version = Constants . TIMER_TASK_V1 ; if ( parsedSchedule != null ) { version = Constants . TIMER_TASK_V2 ; } out . defaultWriteObject ( ) ; out . write ( EYECATCHER ) ; out . writeShort ( PLATFORM ) ; out . writeShort ( version ) ; out . writeObject ( j2eeName . getBytes ( ) ) ; out . writeObject ( userInfoBytes ) ; switch ( version ) { case Constants . TIMER_TASK_V1 : out . writeLong ( expiration ) ; out . writeLong ( interval ) ; break ; case Constants . TIMER_TASK_V2 : out . writeObject ( parsedSchedule ) ; out . writeInt ( methodId ) ; out . writeObject ( automaticMethodName ) ; out . writeObject ( automaticClassName ) ; break ; default : break ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "writeObject" ) ; }
Write this object to the ObjectOutputStream .
39,697
private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "readObject" ) ; in . defaultReadObject ( ) ; byte [ ] eyeCatcher = new byte [ EYECATCHER . length ] ; int bytesRead = 0 ; for ( int offset = 0 ; offset < EYECATCHER . length ; offset += bytesRead ) { bytesRead = in . read ( eyeCatcher , offset , EYECATCHER . length - offset ) ; if ( bytesRead == - 1 ) { throw new IOException ( "end of input stream while reading eye catcher" ) ; } } for ( int i = 0 ; i < EYECATCHER . length ; i ++ ) { if ( EYECATCHER [ i ] != eyeCatcher [ i ] ) { String eyeCatcherString = new String ( eyeCatcher ) ; throw new IOException ( "Invalid eye catcher '" + eyeCatcherString + "' in TimerHandle input stream" ) ; } } @ SuppressWarnings ( "unused" ) short incoming_platform = in . readShort ( ) ; short incoming_vid = in . readShort ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "version = " + incoming_vid ) ; if ( incoming_vid != Constants . TIMER_TASK_V1 && incoming_vid != Constants . TIMER_TASK_V2 ) { throw new InvalidObjectException ( "EJB TimerTaskHandler data stream is not of the correct version, this client should be updated." ) ; } byte [ ] j2eeNameBytes = ( byte [ ] ) in . readObject ( ) ; j2eeName = EJSContainer . j2eeNameFactory . create ( j2eeNameBytes ) ; userInfoBytes = ( byte [ ] ) in . readObject ( ) ; switch ( incoming_vid ) { case Constants . TIMER_TASK_V1 : expiration = in . readLong ( ) ; interval = in . readLong ( ) ; break ; case Constants . TIMER_TASK_V2 : parsedSchedule = ( ParsedScheduleExpression ) in . readObject ( ) ; methodId = in . readInt ( ) ; automaticMethodName = ( String ) in . readObject ( ) ; automaticClassName = ( String ) in . readObject ( ) ; break ; default : break ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "readObject: " + this ) ; }
Read this object from the ObjectInputStream .
39,698
protected BeanMetaData getBeanMetaData ( ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getBeanMetaData: " + this ) ; EJSHome home ; try { home = EJSContainer . getDefaultContainer ( ) . getInstalledHome ( j2eeName ) ; if ( ( home . beanMetaData . timedMethodInfos ) == null ) { Tr . warning ( tc , "HOME_NOT_FOUND_CNTR0092W" , j2eeName ) ; throw new EJBNotFoundException ( "Incompatible Application Change: " + j2eeName + " no longer supports timers." ) ; } } catch ( EJBNotFoundException ejbnfex ) { FFDCFilter . processException ( ejbnfex , CLASS_NAME + ".getBeanMetaData" , "635" , this ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getBeanMetaData: Failed locating timer bean " + j2eeName + " : " + ejbnfex ) ; throw new TimerServiceException ( "Failed locating timer bean " + j2eeName , ejbnfex ) ; } BeanMetaData bmd = home . beanMetaData ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getBeanMetaData: " + bmd ) ; return bmd ; }
Gets BeanMetaData through EJSHome lookup
39,699
private static byte [ ] serializeObject ( Object obj ) { if ( obj == null ) { return null ; } ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { ObjectOutputStream out = new ObjectOutputStream ( baos ) ; out . writeObject ( obj ) ; out . flush ( ) ; } catch ( IOException ioex ) { throw new EJBException ( "Timer info object failed to serialize." , ioex ) ; } return baos . toByteArray ( ) ; }
Internal convenience method for serializing the user info object to a byte array .