idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
24,600 | void processFileRefresh ( boolean doFilterPaths , String listenerFilter ) { externalScan ( null , null , null , doFilterPaths , listenerFilter ) ; } | Processes file refresh operations for specific listeners . |
24,601 | public JsMessage next ( ) throws SIResourceException , SISessionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "next" ) ; JsMessage msg = null ; Iterator < BrowseCursor > it = cursors . iterator ( ) ; while ( it . hasNext ( ) && msg == null ) msg = it . next ( ) . next ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "next" ) ; return msg ; } | The gathering browse will browse messages from the local itemstream as a priority . If none are found it will move through the other queue points until it finds a message . |
24,602 | public static void sortFile ( List < File > jarsList , final String fName ) { Collections . sort ( jarsList , new Comparator < File > ( ) { public int compare ( File f1 , File f2 ) { String f1Name = f1 . getName ( ) ; f1Name = f1Name . substring ( fName . length ( ) + 1 , f1Name . length ( ) - 4 ) ; String f2Name = f2 . getName ( ) ; f2Name = f2Name . substring ( fName . length ( ) + 1 , f2Name . length ( ) - 4 ) ; Version v1 = Version . createVersion ( f1Name ) ; Version v2 = Version . createVersion ( f2Name ) ; if ( v1 != null && v2 != null ) return v1 . compareTo ( v2 ) ; return f1Name . compareTo ( f2Name ) ; } } ) ; } | Compare files in jarsList based on file name s length Sort the files depending on the comparison |
24,603 | public static String encode ( String s ) { if ( s == null ) { return null ; } StringBuilder builder = null ; int begin = 0 ; for ( int i = 0 , length = s . length ( ) ; i < length ; i ++ ) { char ch = s . charAt ( i ) ; switch ( ch ) { case 'a' : case 'b' : case 'c' : case 'd' : case 'e' : case 'f' : case 'g' : case 'h' : case 'i' : case 'j' : case 'k' : case 'l' : case 'm' : case 'n' : case 'o' : case 'p' : case 'q' : case 'r' : case 's' : case 't' : case 'u' : case 'v' : case 'w' : case 'x' : case 'y' : case 'z' : case 'A' : case 'B' : case 'C' : case 'D' : case 'E' : case 'F' : case 'G' : case 'H' : case 'I' : case 'J' : case 'K' : case 'L' : case 'M' : case 'N' : case 'O' : case 'P' : case 'Q' : case 'R' : case 'S' : case 'T' : case 'U' : case 'V' : case 'W' : case 'X' : case 'Y' : case 'Z' : case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : case '-' : case '_' : case '.' : case '!' : case '~' : case '*' : case '\'' : case '(' : case ')' : case '/' : case ';' : case ':' : case '@' : case '&' : case '=' : case '+' : case '$' : case ',' : break ; default : if ( builder == null ) { builder = new StringBuilder ( ) ; } builder . append ( s , begin , i ) ; begin = i + 1 ; if ( ch <= 0x7f ) { appendURLEscapeEncoding ( builder , ch ) ; } else if ( ch <= 0x7ff ) { appendURLEscapeEncoding ( builder , 0xc0 | ( ch >> 6 ) ) ; appendURLEscapeEncoding ( builder , 0x80 | ( ch & 0x3f ) ) ; } else { appendURLEscapeEncoding ( builder , 0xe0 | ( ch >> 12 ) ) ; appendURLEscapeEncoding ( builder , 0x80 | ( ( ch >> 6 ) & 0x3f ) ) ; appendURLEscapeEncoding ( builder , 0x80 | ( ch & 0x3f ) ) ; } break ; } } if ( builder != null ) { return builder . append ( s , begin , s . length ( ) ) . toString ( ) ; } return s ; } | Encodes a URL path string . This method is suitable only for URL path strings and is unsuitable for other URL components . |
24,604 | private static void appendURLEscapeEncoding ( StringBuilder builder , int ch ) { builder . append ( '%' ) ; builder . append ( Character . forDigit ( ch >> 4 , 16 ) ) ; builder . append ( Character . forDigit ( ch & 0xf , 16 ) ) ; } | Append a URL escape encoding for the specified character byte . |
24,605 | public void complete ( VirtualConnection vc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "complete() called: vc=" + vc ) ; } if ( vc != null ) { HttpInboundServiceContextImpl mySC = ( HttpInboundServiceContextImpl ) vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPISC ) ; mySC . finishSendError ( ) ; } } | Called by the device side channel when the write has finished . |
24,606 | public void error ( VirtualConnection vc , Throwable t ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "error() called: vc=" + vc + " t=" + t ) ; } if ( vc != null ) { HttpInboundServiceContextImpl mySC = ( HttpInboundServiceContextImpl ) vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPISC ) ; if ( mySC . getHttpConfig ( ) . getDebugLog ( ) . isEnabled ( DebugLog . Level . WARN ) ) { mySC . getHttpConfig ( ) . getDebugLog ( ) . log ( DebugLog . Level . WARN , HttpMessages . MSG_WRITE_FAIL , mySC ) ; } mySC . logLegacyMessage ( ) ; mySC . finishSendError ( ) ; } } | Called by the devide side channel when the write had an error . |
24,607 | protected void startTable ( FacesContext facesContext , UIComponent uiComponent ) throws IOException { ResponseWriter writer = facesContext . getResponseWriter ( ) ; writer . startElement ( HTML . TABLE_ELEM , uiComponent ) ; Map < String , List < ClientBehavior > > behaviors = null ; if ( uiComponent instanceof ClientBehaviorHolder ) { behaviors = ( ( ClientBehaviorHolder ) uiComponent ) . getClientBehaviors ( ) ; if ( ! behaviors . isEmpty ( ) ) { HtmlRendererUtils . writeIdAndName ( writer , uiComponent , facesContext ) ; } else { HtmlRendererUtils . writeIdIfNecessary ( writer , uiComponent , facesContext ) ; } if ( behaviors . isEmpty ( ) && isCommonPropertiesOptimizationEnabled ( facesContext ) ) { CommonPropertyUtils . renderEventProperties ( writer , CommonPropertyUtils . getCommonPropertiesMarked ( uiComponent ) , uiComponent ) ; } else { if ( isCommonEventsOptimizationEnabled ( facesContext ) ) { CommonEventUtils . renderBehaviorizedEventHandlers ( facesContext , writer , CommonPropertyUtils . getCommonPropertiesMarked ( uiComponent ) , CommonEventUtils . getCommonEventsMarked ( uiComponent ) , uiComponent , behaviors ) ; } else { HtmlRendererUtils . renderBehaviorizedEventHandlers ( facesContext , writer , uiComponent , behaviors ) ; } } if ( isCommonPropertiesOptimizationEnabled ( facesContext ) ) { HtmlRendererUtils . renderHTMLAttributes ( writer , uiComponent , HTML . TABLE_ATTRIBUTES ) ; CommonPropertyUtils . renderCommonPassthroughPropertiesWithoutEvents ( writer , CommonPropertyUtils . getCommonPropertiesMarked ( uiComponent ) , uiComponent ) ; } else { HtmlRendererUtils . renderHTMLAttributes ( writer , uiComponent , HTML . TABLE_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS ) ; } } else { HtmlRendererUtils . writeIdIfNecessary ( writer , uiComponent , facesContext ) ; if ( isCommonPropertiesOptimizationEnabled ( facesContext ) ) { HtmlRendererUtils . renderHTMLAttributes ( writer , uiComponent , HTML . TABLE_ATTRIBUTES ) ; CommonPropertyUtils . renderCommonPassthroughProperties ( writer , CommonPropertyUtils . getCommonPropertiesMarked ( uiComponent ) , uiComponent ) ; } else { HtmlRendererUtils . renderHTMLAttributes ( writer , uiComponent , HTML . TABLE_PASSTHROUGH_ATTRIBUTES ) ; } } } | actually render the start of the table |
24,608 | public void encodeChildren ( FacesContext facesContext , UIComponent component ) throws IOException { RendererUtils . checkParamValidity ( facesContext , component , UIData . class ) ; beforeBody ( facesContext , ( UIData ) component ) ; encodeInnerHtml ( facesContext , component ) ; afterBody ( facesContext , ( UIData ) component ) ; } | Render the TBODY section of the html table . See also method encodeInnerHtml . |
24,609 | protected void renderCaptionFacet ( FacesContext facesContext , ResponseWriter writer , UIComponent component ) throws IOException { HtmlRendererUtils . renderTableCaption ( facesContext , writer , component ) ; } | Renders the caption facet . |
24,610 | protected void renderColgroupsFacet ( FacesContext facesContext , ResponseWriter writer , UIComponent component ) throws IOException { UIComponent colgroupsFacet = component . getFacet ( "colgroups" ) ; if ( colgroupsFacet == null ) { return ; } colgroupsFacet . encodeAll ( facesContext ) ; } | Renders the colgroups facet . |
24,611 | protected static Styles getStyles ( UIData uiData ) { String rowClasses ; String columnClasses ; if ( uiData instanceof HtmlDataTable ) { rowClasses = ( ( HtmlDataTable ) uiData ) . getRowClasses ( ) ; columnClasses = ( ( HtmlDataTable ) uiData ) . getColumnClasses ( ) ; } else { rowClasses = ( String ) uiData . getAttributes ( ) . get ( JSFAttr . ROW_CLASSES_ATTR ) ; columnClasses = ( String ) uiData . getAttributes ( ) . get ( JSFAttr . COLUMN_CLASSES_ATTR ) ; } return new Styles ( rowClasses , columnClasses ) ; } | Gets styles for the specified component . |
24,612 | protected void renderRowStart ( FacesContext facesContext , ResponseWriter writer , UIData uiData , Styles styles , int rowStyleIndex ) throws IOException { writer . startElement ( HTML . TR_ELEM , null ) ; renderRowStyle ( facesContext , writer , uiData , styles , rowStyleIndex ) ; Object rowId = uiData . getAttributes ( ) . get ( org . apache . myfaces . shared . renderkit . JSFAttr . ROW_ID ) ; if ( rowId != null ) { writer . writeAttribute ( HTML . ID_ATTR , rowId . toString ( ) , null ) ; } } | Renders the start of a new row of body content . |
24,613 | protected void renderRowEnd ( FacesContext facesContext , ResponseWriter writer , UIData uiData ) throws IOException { writer . endElement ( HTML . TR_ELEM ) ; } | Renders the end of a row of body content . |
24,614 | protected void endTable ( FacesContext facesContext , UIComponent uiComponent ) throws IOException { ResponseWriter writer = facesContext . getResponseWriter ( ) ; writer . endElement ( HTML . TABLE_ELEM ) ; } | actually render the end of the table |
24,615 | protected void renderTableHeaderRow ( FacesContext facesContext , ResponseWriter writer , UIComponent component , UIComponent headerFacet , String headerStyleClass , int colspan ) throws IOException { renderTableHeaderOrFooterRow ( facesContext , writer , component , headerFacet , headerStyleClass , determineHeaderCellTag ( facesContext , component ) , colspan , true ) ; } | Renders the header row of the table being rendered . |
24,616 | protected void renderTableFooterRow ( FacesContext facesContext , ResponseWriter writer , UIComponent component , UIComponent footerFacet , String footerStyleClass , int colspan ) throws IOException { renderTableHeaderOrFooterRow ( facesContext , writer , component , footerFacet , footerStyleClass , HTML . TD_ELEM , colspan , false ) ; } | Renders the footer row of the table being rendered . |
24,617 | protected void renderSpacerCell ( FacesContext facesContext , ResponseWriter writer , UIComponent component ) throws IOException { UIComponent spacer = getNewspaperTableSpacer ( component ) ; if ( spacer == null ) { return ; } writer . startElement ( HTML . TD_ELEM , null ) ; spacer . encodeAll ( facesContext ) ; writer . endElement ( HTML . TD_ELEM ) ; } | Renders a spacer between adjacent newspaper columns . |
24,618 | public static Trace getTrace ( Class sourceClass , String traceGroup ) { Class traceFactoryClass ; Object ret = null ; try { traceFactoryClass = Class . forName ( "com.ibm.ws.sib.matchspace.utils.TraceFactory" ) ; Class [ ] params = new Class [ ] { Class . class , String . class } ; Method getTraceMethod = traceFactoryClass . getMethod ( "getTrace" , params ) ; Object [ ] objParams = new Object [ ] { sourceClass , traceGroup } ; ret = getTraceMethod . invoke ( null , objParams ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return ( Trace ) ret ; } | Wrapper method to get the trace via the Factory . |
24,619 | private long updateMessageWaitTime ( ) { long timeNow = java . lang . System . currentTimeMillis ( ) ; long latestWaitTimeUpdate = calculateWaitTimeUpdate ( timeNow ) ; long messageWaitTime = latestWaitTimeUpdate + _js_messageWaitTime . longValue ( ) ; return messageWaitTime ; } | Update the message wait time |
24,620 | public void setMessageListener ( MessageListener listener ) throws JMSException { boolean checkManaged = true ; _setMessageListener ( listener , checkManaged ) ; } | assign a MessageListener to this consumer for async message delivery . |
24,621 | protected void start ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "start" ) ; if ( coreConsumerSession != null ) { try { synchronized ( closedLock ) { if ( ! closed ) { coreConsumerSession . start ( false ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Avoided starting a consumer that has been closed." ) ; } } } catch ( SIException sice ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "EXCEPTION_RECEIVED_CWSIA0085" , new Object [ ] { sice , "JmsMsgConsumerImpl.start" } , sice , null , this , tc ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" ) ; } | Method start . |
24,622 | protected void stop ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "stop" ) ; if ( coreConsumerSession != null ) { try { coreConsumerSession . stop ( ) ; } catch ( SIException sice ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "EXCEPTION_RECEIVED_CWSIA0085" , new Object [ ] { sice , "JmsMsgConsumerImpl.stop" } , sice , null , this , tc ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "coreConsumerSession is null, already closed ?" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "stop" ) ; } | Method stop . |
24,623 | void checkClosed ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "checkClosed" ) ; synchronized ( closedLock ) { if ( closed ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( javax . jms . IllegalStateException . class , "CONSUMER_CLOSED_CWSIA0081" , null , tc ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "checkClosed" ) ; } | This method is called at the beginning of every method that should not work if the consumer has been closed . It prevents further execution by throwing a JMSException with a suitable I m closed message . |
24,624 | private void setAsyncListener ( MessageListener listener ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setAsyncListener" , listener ) ; consumer = new Consumer ( listener , session , sessionAckMode ) ; try { coreConsumerSession . stop ( ) ; int batchSize = 1 ; boolean deliverImmediately = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Registering async callback for consumer" + consumer ) ; coreConsumerSession . registerAsynchConsumerCallback ( consumer , 0 , 0 , batchSize , session . getOrderingContext ( ) ) ; if ( session . getState ( ) == STARTED ) coreConsumerSession . start ( deliverImmediately ) ; } catch ( SIIncorrectCallException sie ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "EXCEPTION_RECEIVED_CWSIA0085" , new Object [ ] { sie , "JmsMsgConsumerImpl.setAsyncListener" } , sie , "JmsMsgConsumerImpl.setAsyncListener#1" , this , tc ) ; } catch ( SIException sie ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "EXCEPTION_RECEIVED_CWSIA0085" , new Object [ ] { sie , "JmsMsgConsumerImpl.setAsyncListener" } , sie , null , this , tc ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setAsyncListener" ) ; } | internal method for assigning a message listener |
24,625 | private void removeAsyncListener ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeAsyncListener" ) ; if ( consumer != null ) { try { coreConsumerSession . stop ( ) ; coreConsumerSession . deregisterAsynchConsumerCallback ( ) ; if ( session . getState ( ) == STARTED ) { coreConsumerSession . start ( false ) ; } consumer = null ; } catch ( SIIncorrectCallException sice ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "EXCEPTION_RECEIVED_CWSIA0085" , new Object [ ] { sice , "JmsMsgConsumerImpl.removeAsyncListener" } , sice , "JmsMsgConsumerImpl.removeASyncListener#1" , this , tc ) ; } catch ( SIException sice ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "EXCEPTION_RECEIVED_CWSIA0085" , new Object [ ] { sice , "JmsMsgConsumerImpl.removeAsyncListener" } , sice , null , this , tc ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeAsyncListener" ) ; } | This method is used to remove an existing asynchronous consumer from the core consumer object and reset the JMS consumer back to sychronous receipt mode . |
24,626 | boolean getNoLocalFlag ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getNoLocalFlag" ) ; checkClosed ( ) ; boolean nl = props . noLocal ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getNoLocalFlag" , nl ) ; return nl ; } | Get the noLocal flag . |
24,627 | private void emergencyClose ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "emergencyClose" ) ; try { if ( coreConsumerSession != null ) coreConsumerSession . close ( ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.api.jms.impl.JmsMsgConsumerImpl" , "emergencyClose#1" , this ) ; } finally { coreConsumerSession = null ; closed = true ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "emergencyClose" ) ; } | Provides a minimalist abrupt shutdown of the consumer . This method is used from the async delivery code and its primary purpose is to prevent further message loss in the face of unrecoverable errors during message delivery . |
24,628 | private boolean parseClassSecurity ( Class < ? > cls , SecurityContext sc ) { DenyAll denyAll = cls . getAnnotation ( DenyAll . class ) ; if ( denyAll != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Found class level @DenyAll - authorization denied for " + cls . getName ( ) ) ; } return false ; } else { RolesAllowed rolesAllowed = cls . getAnnotation ( RolesAllowed . class ) ; if ( rolesAllowed != null ) { String [ ] theseroles = rolesAllowed . value ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "found RolesAllowed in class level: {} " + cls . getName ( ) , new Object [ ] { theseroles } ) ; } if ( ! ensureAuthentication ( sc ) ) { return false ; } if ( ! isUserInRole ( sc , Arrays . asList ( theseroles ) , false ) ) { return false ; } return true ; } else { return true ; } } } | parse security JSR250 annotations at the class level |
24,629 | public final short getReason ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "getReason" , toString ( reason ) ) ; return reason ; } | Returns the reason code for the task failure . |
24,630 | private void registerService ( BundleContext bc , String name , Object serviceInstance ) { Dictionary < String , Object > properties = new Hashtable < String , Object > ( ) ; properties . put ( "service.vendor" , "IBM" ) ; bc . registerService ( name , serviceInstance , properties ) ; } | Register a service with default properties |
24,631 | BaseConfiguration addDefaultConfiguration ( String pid , Dictionary < String , String > props ) throws ConfigUpdateException { return defaultConfiguration . add ( pid , props , serverXMLConfig , variableRegistry ) ; } | Add configuration to the default configuration add runtime |
24,632 | BaseConfiguration addDefaultConfiguration ( InputStream defaultConfig ) throws ConfigValidationException , ConfigUpdateException { return defaultConfiguration . add ( defaultConfig , serverXMLConfig , variableRegistry ) ; } | Add configuration to the default configuration at runtime using a url |
24,633 | public void activate ( ComponentContext context , Map < String , Object > properties , ConfigurationAdmin configAdmin ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "activate" , new Object [ ] { context , properties , configAdmin } ) ; } try { _state = ME_STATE . STARTING . toString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "Starting the JMS server." ) ; } initialize ( context , properties , configAdmin ) ; _jsMainImpl = new JsMainImpl ( context . getBundleContext ( ) ) ; _jsMainImpl . initialize ( jsMEConfig ) ; _jsMainImpl . start ( ) ; _state = ME_STATE . STARTED . toString ( ) ; SibTr . info ( tc , "ME_STARTED_SIAS0108" ) ; } catch ( InvalidFileStoreConfigurationException ifs ) { _state = ME_STATE . STOPPED . toString ( ) ; SibTr . error ( tc , "ME_STOPPED_SIAS0109" ) ; SibTr . exception ( tc , ifs ) ; FFDCFilter . processException ( ifs , "com.ibm.ws.messaging.service.JsMainAdminServiceImpl" , "132" , this ) ; } catch ( Exception e ) { _state = ME_STATE . STOPPED . toString ( ) ; SibTr . error ( tc , "ME_STOPPED_SIAS0109" ) ; SibTr . exception ( tc , e ) ; FFDCFilter . processException ( e , "com.ibm.ws.messaging.service.JsMainAdminServiceImpl" , "139" , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "activate" ) ; } } | Constructs the JsMEConfig object based upon the Map and Activates various ME components |
24,634 | private void initialize ( ComponentContext context , Map < String , Object > properties , ConfigurationAdmin configAdmin ) throws InvalidFileStoreConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "initialize" , new Object [ ] { context , properties } ) ; } this . properties = properties ; this . bundleLocation = context . getBundleContext ( ) . getBundle ( ) . getLocation ( ) ; SIBFileStore filestore = new SIBFileStoreImpl ( ) ; populateFileStore ( properties , filestore , configAdmin ) ; SIBus bus = new SIBusImpl ( ) ; SIBMessagingEngine messagingEngine = new SIBMessagingEngineImpl ( ) ; messagingEngine . setHighMessageThreshold ( ( Long ) properties . get ( JsAdminConstants . HIGHMESSAGETHRESHOLD ) ) ; HashMap < String , BaseDestination > destinationList = new HashMap < String , BaseDestination > ( ) ; HashMap < String , SIBLocalizationPoint > destinationLocalizationList = new HashMap < String , SIBLocalizationPoint > ( ) ; populateDestinations ( properties , destinationList , destinationLocalizationList , messagingEngine . getName ( ) , JsAdminConstants . QUEUE , configAdmin , false ) ; populateDestinations ( properties , destinationList , destinationLocalizationList , messagingEngine . getName ( ) , JsAdminConstants . TOPICSPACE , configAdmin , false ) ; populateAliasDestinations ( properties , destinationList , configAdmin ) ; messagingEngine . setDestinationList ( destinationList ) ; messagingEngine . setSibLocalizationPointList ( destinationLocalizationList ) ; jsMEConfig . setMessagingEngine ( messagingEngine ) ; jsMEConfig . setSIBFilestore ( filestore ) ; jsMEConfig . setSIBus ( bus ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "initialize" ) ; } } | Initializes the JsMEConfig Object Creates a defaultQueue and defaultTopic as well . If filestore is not mentioned in server . xml an default filestore is created |
24,635 | private void populateFileStore ( Map < String , Object > properties , SIBFileStore filestore , ConfigurationAdmin configAdmin ) throws InvalidFileStoreConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "populateFileStore" , new Object [ ] { properties , filestore , configAdmin } ) ; } String [ ] sFileStore = ( String [ ] ) properties . get ( JsAdminConstants . FILESTORE ) ; if ( sFileStore == null ) { String path = null ; path = resolveFileStorePath ( filestore . getPath ( ) ) ; filestore . setPath ( path ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "The filestore path: " + path ) ; SibTr . debug ( this , tc , "FileStore tag has not been defined in the server.xml file, hence defaults will be considered." ) ; } } else { pids . add ( sFileStore [ 0 ] ) ; Configuration config = null ; try { config = configAdmin . getConfiguration ( sFileStore [ 0 ] , bundleLocation ) ; } catch ( IOException e ) { SibTr . exception ( tc , e ) ; FFDCFilter . processException ( e , this . getClass ( ) . getName ( ) , "671" , this ) ; } Dictionary fsProp = config . getProperties ( ) ; String fsPath = ( String ) fsProp . get ( JsAdminConstants . PATH ) ; File dummyFile = new File ( fsPath ) ; if ( dummyFile . isAbsolute ( ) ) { filestore . setPath ( fsPath ) ; } else { String completePath = WsLocationConstants . SYMBOL_SERVER_OUTPUT_DIR + "/messaging/" + fsPath ; filestore . setPath ( resolveFileStorePath ( completePath ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "The filestore path: " + filestore . getPath ( ) ) ; } filestore . setFileStoreSize ( ( Long ) fsProp . get ( JsAdminConstants . FILESTORESIZE ) * 1024 * 1024 ) ; filestore . setLogFileSize ( ( Long ) fsProp . get ( JsAdminConstants . LOGFILESIZE ) * 1024 * 1024 ) ; filestore . validateFileStoreSettings ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "populateFileStore" ) ; } } | A SIBFilestore object is created using the filestore tag mentioned in the server . xml If nothing is mentioned in the server . xml the defaults are considered |
24,636 | protected Map < String , String > getMpConfigMap ( MpConfigProxyService service , ClassLoader cl , Map < String , String > map ) { Arrays . asList ( MpConstants . ISSUER , MpConstants . PUBLIC_KEY , MpConstants . KEY_LOCATION ) . forEach ( s -> getMpConfig ( service , cl , s , map ) ) ; return map ; } | no null check . make sure that the caller sets non null objects . |
24,637 | @ FFDCIgnore ( { NoSuchElementException . class } ) protected Map < String , String > getMpConfig ( MpConfigProxyService service , ClassLoader cl , String propertyName , Map < String , String > map ) { try { String value = service . getConfigValue ( cl , propertyName , String . class ) . trim ( ) ; if ( ! value . isEmpty ( ) ) { map . put ( propertyName , value ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , propertyName + " is empty. Ignore it." ) ; } } } catch ( NoSuchElementException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , propertyName + " is not in mpConfig." ) ; } } return map ; } | no null check other than cl . make sure that the caller sets non null objects . |
24,638 | public void loadLibraries ( FacesContext context , Compiler compiler ) { ExternalContext eContext = context . getExternalContext ( ) ; MyfacesConfig config = MyfacesConfig . getCurrentInstance ( eContext ) ; compiler . addTagLibrary ( new CoreLibrary ( ) ) ; compiler . addTagLibrary ( new HtmlLibrary ( ) ) ; if ( config . isStrictJsf2FaceletsCompatibility ( ) ) { compiler . addTagLibrary ( new LegacyUILibrary ( ) ) ; compiler . addTagLibrary ( new LegacyJstlCoreLibrary ( ) ) ; compiler . addTagLibrary ( new LegacyJstlCoreLibrary ( JstlCoreLibrary . ALTERNATIVE_NAMESPACE ) ) ; } else { compiler . addTagLibrary ( new UILibrary ( ) ) ; compiler . addTagLibrary ( new JstlCoreLibrary ( ) ) ; compiler . addTagLibrary ( new JstlCoreLibrary ( JstlCoreLibrary . ALTERNATIVE_NAMESPACE ) ) ; } compiler . addTagLibrary ( new JstlFnLibrary ( ) ) ; compiler . addTagLibrary ( new CompositeLibrary ( ) ) ; compiler . addTagLibrary ( new CompositeResourceLibrary ( context , CompositeResourceLibrary . NAMESPACE_PREFIX ) ) ; compiler . addTagLibrary ( new CompositeResourceLibrary ( context , CompositeResourceLibrary . ALIAS_NAMESPACE_PREFIX ) ) ; compiler . addTagLibrary ( new JsfLibrary ( ) ) ; compiler . addTagLibrary ( new PassThroughLibrary ( ) ) ; RuntimeConfig runtimeConfig = RuntimeConfig . getCurrentInstance ( eContext ) ; if ( ! runtimeConfig . getComponentTagDeclarations ( ) . isEmpty ( ) ) { ComponentTagDeclarationLibrary componentTagDeclarationLibrary = new ComponentTagDeclarationLibrary ( ) ; LoadComponentTagDeclarationFacesContextWrapper wrappedFacesContext = new LoadComponentTagDeclarationFacesContextWrapper ( context ) ; try { wrappedFacesContext . setWrapperAsCurrentFacesContext ( ) ; UIViewRoot root = new UIViewRoot ( ) ; root . setRenderKitId ( "HTML_BASIC" ) ; wrappedFacesContext . setViewRoot ( new UIViewRoot ( ) ) ; for ( ComponentTagDeclaration declaration : runtimeConfig . getComponentTagDeclarations ( ) ) { UIComponent component = context . getApplication ( ) . createComponent ( declaration . getComponentType ( ) ) ; componentTagDeclarationLibrary . addComponent ( declaration . getNamespace ( ) , declaration . getTagName ( ) , declaration . getComponentType ( ) , component . getRendererType ( ) ) ; } } finally { wrappedFacesContext . restoreCurrentFacesContext ( ) ; } compiler . addTagLibrary ( componentTagDeclarationLibrary ) ; } List < FaceletTagLibrary > faceletTagLibraries = runtimeConfig . getFaceletTagLibraries ( ) ; for ( FaceletTagLibrary faceletTagLibrary : faceletTagLibraries ) { TagLibrary tl = TagLibraryConfig . create ( context , faceletTagLibrary ) ; if ( tl != null ) { compiler . addTagLibrary ( tl ) ; } } } | Load the various tag libraries for Facelets . |
24,639 | public void loadDecorators ( FacesContext context , Compiler compiler ) { String param = WebConfigParamUtils . getStringInitParameter ( context . getExternalContext ( ) , PARAMS_DECORATORS ) ; if ( param != null ) { for ( String decorator : param . split ( ";" ) ) { try { compiler . addTagDecorator ( ( TagDecorator ) ReflectionUtil . forName ( decorator ) . newInstance ( ) ) ; if ( log . isLoggable ( Level . FINE ) ) { log . fine ( "Successfully loaded decorator: " + decorator ) ; } } catch ( Exception e ) { log . log ( Level . SEVERE , "Error Loading decorator: " + decorator , e ) ; } } } } | Load the various decorators for Facelets . |
24,640 | private static ZipFileHandle getZipFileHandle ( String path ) throws IOException { synchronized ( zipFileHandlesLock ) { ZipFileHandle handle = zipFileHandles . get ( path ) ; if ( handle == null ) { handle = new ZipFileHandleImpl ( path ) ; zipFileHandles . put ( path , handle ) ; } return handle ; } } | Answer a zip file handle for a specified path . |
24,641 | public void addFilter ( String filterName ) { _hasFilters = true ; if ( ! WCCustomProperties . DENY_DUPLICATE_FILTER_IN_CHAIN ) { _filterNames . add ( filterName ) ; } else { if ( ! _filterNames . contains ( filterName ) ) { _filterNames . add ( filterName ) ; } else { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "init" , "filter already in chain ->" + filterName ) ; } } } | Adds a filter name to the name vector for this chain |
24,642 | private boolean isHeaderinSuppressedHeadersList ( String headername ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } boolean suppressHeader = false ; if ( headername != null ) { Iterator itList = suppressheadersList . iterator ( ) ; while ( itList . hasNext ( ) && ! ( suppressHeader ) ) { String s = ( String ) itList . next ( ) ; if ( headername . startsWith ( s ) ) { suppressHeader = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "isHeaderinSuppressedHeadersList" , " suppressHeadersInRequest is set and headername + headername + " begins with + s ) ; } } } return suppressHeader ; } | Returns true if header can be suppressed or false if not . |
24,643 | public long getDateHeader ( String name ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } long header = - 1 ; if ( ( suppressHeadersInRequest == null ) || ! ( isHeaderinSuppressedHeadersList ( name ) ) ) { header = _request . getDateHeader ( name ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getDateHeader" , "this->" + this + ": " + " name + name + " header + String . valueOf ( header ) ) ; } return header ; } | Returns the value of a date header field or - 1 if not found . The case of the header field name is ignored . |
24,644 | public Enumeration getHeaderNames ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getHeaderNames" , "this->" + this + ": " ) ; } if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } if ( suppressHeadersInRequest == null ) { return _request . getHeaderNames ( ) ; } else { ArrayList alHeaderNames = new ArrayList ( ) ; Enumeration enumHeaderNames = _request . getHeaderNames ( ) ; while ( enumHeaderNames . hasMoreElements ( ) ) { String headerNameParam = ( String ) enumHeaderNames . nextElement ( ) ; if ( ! ( isHeaderinSuppressedHeadersList ( headerNameParam ) ) ) alHeaderNames . add ( headerNameParam ) ; } return Collections . enumeration ( alHeaderNames ) ; } } | Returns an enumeration of strings representing the header names for this request . Some server implementations do not allow headers to be accessed in this way in which case this method will return null . |
24,645 | public ServletInputStream getInputStream ( ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getInputStream" , "this->" + this + ": gotReader = " + _srtRequestHelper . _gotReader ) ; } if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } if ( this . multiReadPropertyEnabled ) { if ( _srtRequestHelper . _InputStreamClosed ) { ( ( SRTInputStream ) this . _in ) . restart ( ) ; } } if ( _srtRequestHelper . _gotReader ) throw new IllegalStateException ( liberty_nls . getString ( "Reader.already.obtained" , "Reader already obtained" ) ) ; _srtRequestHelper . _gotInputStream = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getInputStream" , "stream->" + _in + ": gotReader = " + _srtRequestHelper . _gotReader ) ; } return _in ; } | Returns an input stream for reading binary request data . |
24,646 | public String getAuthType ( ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } String authType = null ; if ( ( ( WebAppDispatcherContext ) this . getDispatchContext ( ) ) . isSecurityEnabledForApplication ( ) ) { authType = ( String ) getPrivateAttribute ( "AUTH_TYPE" ) ; } else { authType = _request . getAuthType ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getAuthType" , " authType + authType ) ; } if ( authType != null ) { if ( authType . equals ( "BASIC" ) ) return HttpServletRequest . BASIC_AUTH ; else if ( authType . equals ( "CLIENT_CERT" ) ) return HttpServletRequest . CLIENT_CERT_AUTH ; else if ( authType . equals ( "DIGEST" ) ) return HttpServletRequest . DIGEST_AUTH ; else if ( authType . equals ( "FORM" ) ) return HttpServletRequest . FORM_AUTH ; } return authType ; } | Returns the authentication scheme of the request or null if none . Same as the CGI variable AUTH_TYPE . |
24,647 | public String getParameter ( String name ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getParameter" , " name + name ) ; } if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } parseParameters ( ) ; String [ ] values = ( String [ ] ) SRTServletRequestThreadData . getInstance ( ) . getParameters ( ) . get ( name ) ; String value = null ; if ( values != null && values . length > 0 ) { value = values [ 0 ] ; } if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getParameter" , " value + name ) ; } return value ; } | Returns the value of the specified parameter for the request . For example in an HTTP servlet this would return the value of the specified query string parameter . This must be used when the application is sure that there is only one value for the parameter . For multiple valued parameters use getParameterValues . |
24,648 | public String [ ] getParameterValues ( String name ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } parseParameters ( ) ; String [ ] values = ( String [ ] ) SRTServletRequestThreadData . getInstance ( ) . getParameters ( ) . get ( name ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getParameterValues" , " name + name ) ; } if ( WCCustomProperties . PRESERVE_REQUEST_PARAMETER_VALUES ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getParameterValues" , " returning a clone of parameter values" ) ; } return ( values == null ? null : values . clone ( ) ) ; } else { return values ; } } | Returns the value of the specified parameter for the request . For example in an HTTP servlet this would return the value of the specified query string parameter . |
24,649 | public String getPathInfo ( ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } SRTServletRequestThreadData reqData = SRTServletRequestThreadData . getInstance ( ) ; if ( reqData . getPathInfo ( ) == null ) { String aPathInfo = ( ( WebAppDispatcherContext ) this . getDispatchContext ( ) ) . getPathInfo ( ) ; if ( aPathInfo == null ) return null ; else { reqData . setPathInfo ( WebGroup . stripURL ( aPathInfo , false ) ) ; } } String path = reqData . getPathInfo ( ) ; if ( path . equals ( "" ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "getPathInfo" , " path is \"\", returning null" ) ; return null ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "getPathInfo" , " path + path + "]" ) ; return path ; } } | Returns null since this request has no concept of servlet mappings . This method will be overidden by the webapp layer . |
24,650 | public String getQueryString ( ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } SRTServletRequestThreadData reqData = SRTServletRequestThreadData . getInstance ( ) ; if ( reqData . getQueryString ( ) == null && ! reqData . isQSSetExplicit ( ) ) if ( _request != null && reqData != null ) { reqData . setQueryString ( _request . getQueryString ( ) ) ; } String queryString = null ; if ( reqData != null ) queryString = reqData . getQueryString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getQueryString" , " queryString + PasswordNullifier . nullifyParams ( queryString ) ) ; } return queryString ; } | Returns the query string part of the servlet URI or null if none . Same as the CGI variable QUERY_STRING . |
24,651 | public String getRemoteUser ( ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } String remoteUser = null ; Principal principal = getUserPrincipal ( ) ; if ( principal == null ) { if ( _request != null ) { remoteUser = _request . getRemoteUser ( ) ; } } else { remoteUser = principal . getName ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getRemoteUser" , "(security enabled)" ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getRemoteUser" , "user=" + remoteUser ) ; } return remoteUser ; } | Returns the name of the user making this request or null if not known . Same as the CGI variable REMOTE_USER . This logic is delegatd to the registered IWebAppSecurityCollaborator . |
24,652 | public String getRequestURI ( ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } SRTServletRequestThreadData reqData = SRTServletRequestThreadData . getInstance ( ) ; if ( reqData != null && reqData . getRequestURI ( ) == null ) { String aURI = getEncodedRequestURI ( ) ; if ( aURI == null ) return null ; else reqData . setRequestURI ( WebGroup . stripURL ( aURI ) ) ; } String uri = null ; if ( reqData != null ) uri = reqData . getRequestURI ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getRequestURI" , " uri + uri ) ; } return uri ; } | Returns the request URI as string . |
24,653 | public String getServerName ( ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } String sName = this . _request . getServerName ( ) ; if ( sName == null || sName . length ( ) == 0 ) { try { sName = InetAddress . getLocalHost ( ) . getHostName ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getServerName" , "using InetAddress + sName ) ; } } catch ( Throwable th ) { } } if ( sName . charAt ( 0 ) != '[' && sName . indexOf ( ':' ) != - 1 ) sName = "[" + sName + "]" ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getServerName" , "serverName + sName ) ; } return sName ; } | Returns the host name of the server that received the request . Same as the CGI variable SERVER_NAME . |
24,654 | public boolean isRequestedSessionIdValid ( ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } boolean sessionInvalid = _requestContext . isRequestedSessionIdValid ( ( ( WebAppDispatcherContext ) this . getDispatchContext ( ) ) . getWebApp ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "isRequestedSessionIdValid" , " " + String . valueOf ( sessionInvalid ) ) ; } return sessionInvalid ; } | If the session doesn t exist then the Id that came in is invalid . If there is no sessionID in the request then it s not valid . |
24,655 | protected Hashtable parsePostData ( ) throws IOException { if ( getContentLength ( ) > 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "parsePostData" , "parsing post data based upon content length" ) ; return RequestUtils . parsePostData ( getContentLength ( ) , getInputStream ( ) , getReaderEncoding ( ) , this . multiReadPropertyEnabled ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "parsePostData" , "parsing post data based upon input stream (possibly chunked)" ) ; return RequestUtils . parsePostData ( getInputStream ( ) , getReaderEncoding ( ) , this . multiReadPropertyEnabled ) ; } | Added for servlet 3 . 1 support - method is overidden by SRTServletRequest31 |
24,656 | public void finish ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "finish" , "entry" ) ; } if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } try { int length = getContentLength ( ) ; if ( length > 0 ) { _in . close ( ) ; } else { this . _in . finish ( ) ; } } catch ( IOException e ) { com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( e , "com.ibm.ws.webcontainer.srt.SRTServletRequest.finish" , "875" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "finish" , "Error occurred while finishing request" , e ) ; } } finally { cleanupFromFinish ( ) ; } } | Close this request . This method must be called after the request has been processed . |
24,657 | public void popParameterStack ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "popParameterStack" , "entry" ) ; } if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } try { SRTServletRequestThreadData . getInstance ( ) . setParameters ( ( Hashtable ) _paramStack . pop ( ) ) ; } catch ( java . util . EmptyStackException empty ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "popParameterStack" , "Unable to remove item from stack" , empty ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) && SRTServletRequestThreadData . getInstance ( ) . getParameters ( ) != null ) { debugParams ( SRTServletRequestThreadData . getInstance ( ) . getParameters ( ) ) ; } } | Revert the state of the parameters which was saved before an include call |
24,658 | public java . util . Map getParameterMap ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getParameterMap" , "" ) ; } if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } parseParameters ( ) ; return ( Map ) SRTServletRequestThreadData . getInstance ( ) . getParameters ( ) ; } | Returns a java . util . Map of the parameters of this request . Request parameters are extra information sent with the request . For HTTP servlets parameters are contained in the query string or posted form data . |
24,659 | public java . lang . StringBuffer getRequestURL ( ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } StringBuffer fullURL = new StringBuffer ( ) ; String scheme = getScheme ( ) ; int port = getServerPort ( ) ; fullURL . append ( scheme ) ; fullURL . append ( "://" ) ; fullURL . append ( getServerName ( ) ) ; if ( ( scheme . equals ( "http" ) && port != 80 ) || ( scheme . equals ( "https" ) && port != 443 ) ) { fullURL . append ( ':' ) ; fullURL . append ( getServerPort ( ) ) ; } fullURL . append ( getEncodedRequestURI ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getRequestURL" , "url + fullURL ) ; } return fullURL ; } | Reconstructs the URL the client used to make the request . The returned URL contains a protocol server name port number and server path but it does not include query string parameters . |
24,660 | public List getAllCookieValues ( String cookieName ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } List cookieValues = _request . getAllCookieValues ( cookieName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getAllCookieValues" , " name + cookieName + " values + cookieValues ) ; } return cookieValues ; } | Get the values for the cookie specified . |
24,661 | public Object getSessionAffinityContext ( ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } Object sac = _srtRequestHelper . _sessionAffinityContext ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getSessionAffinityContext" , " sac + sac ) ; } return sac ; } | LIDB4395 cmd start |
24,662 | public String getEncodedRequestURI ( ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } String uri = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getEncodedRequestURI" , "" ) ; } if ( getDispatchContext ( ) == null ) uri = _request . getRequestURI ( ) ; else uri = getDispatchContext ( ) . getRequestURI ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getEncodedRequestURI" , " uri + uri ) ; } return uri ; } | LIDB4395 cmd end |
24,663 | public boolean getRunningCollaborators ( ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getRunningCollaborators" , " value + String . valueOf ( _runningCollaborators ) ) ; } return _runningCollaborators ; } | Returns a boolean that indicates if collaborators are running . Session Manager needs this to suppress throwing UnauthorizedSessionRequestExceptions when getSession is called by collaborators rather than the application . PK01801 |
24,664 | public void setDispatcherType ( DispatcherType dispatcherType ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "setDispatcherType" , "dispatcherType->" + dispatcherType ) ; if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } this . _srtRequestHelper . dispatcherType = dispatcherType ; } | whether include or forward was used . |
24,665 | protected Part morphIntoPart ( DiskFileItem commonsFile ) { if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } Part p = new SRTServletRequestPart ( commonsFile ) ; return p ; } | replaced for Servlet 3 . 1 |
24,666 | @ SuppressWarnings ( "rawtypes" ) public long sizeInputStreamData ( Map isd ) throws UnsupportedEncodingException , IllegalStateException { validateInputStreamData ( isd ) ; long size = LENGTH_INT + LENGTH_LONG ; String type = ( String ) isd . get ( INPUT_STREAM_CONTENT_TYPE ) ; if ( type != null ) { size += type . getBytes ( "UTF-8" ) . length ; } else { size += 1 ; } byte [ ] data = ( byte [ ] ) isd . get ( INPUT_STREAM_CONTENT_DATA ) ; if ( data != null ) { size += data . length ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "sizeInputStreamData" , Long . toString ( size ) ) ; return size ; } | returns estimated size of serialized InputStreamData this code does not consider that the length in long overwraps . |
24,667 | @ SuppressWarnings ( "rawtypes" ) protected void validateInputStreamData ( Map isd ) throws IllegalStateException { String message = null ; if ( isd != null ) { if ( isd . size ( ) <= 3 ) { boolean type = isd . containsKey ( INPUT_STREAM_CONTENT_TYPE ) ; boolean length = isd . containsKey ( INPUT_STREAM_CONTENT_DATA_LENGTH ) ; boolean data = isd . containsKey ( INPUT_STREAM_CONTENT_DATA ) ; if ( type && length && data ) { return ; } else { message = "One of required values of InputStreamData is missing. type : " + type + " length : " + length + " data : " + data ; } } else { message = "InputStreamData contains an unrecognized item." ; } } else { message = "InputStreamData is null." ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "validateInputStreamData" , message ) ; throw new IllegalStateException ( message ) ; } | verify the InputStreamData Map object contains required value . throws IllegalStateException if there is any missing values . |
24,668 | protected Validator createValidator ( FaceletContext ctx ) { return ctx . getFacesContext ( ) . getApplication ( ) . createValidator ( this . getValidatorId ( ctx ) ) ; } | Uses the specified validatorId to get a new Validator instance from the Application . |
24,669 | public synchronized boolean addChangeListener ( ChangeListener listener ) { if ( bEnableListener && listener != null ) { eventSource . addListener ( listener ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "addChangeListener() cacheName=" + this . cacheName + " listener=" + eventSource . getChangeListenerCount ( ) ) ; } return true ; } return false ; } | This is a helper method to add change listener to all entries . |
24,670 | public synchronized boolean addInvalidationListener ( InvalidationListener listener ) { if ( bEnableListener && listener != null ) { eventSource . addListener ( listener ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "addInvalidationListener() cacheName=" + this . cacheName + " listener=" + eventSource . getInvalidationListenerCount ( ) ) ; } return true ; } return false ; } | This is a helper method to add invalidation listener to all entries . |
24,671 | public synchronized boolean addPreInvalidationListener ( PreInvalidationListener listener ) { if ( bEnableListener && listener != null ) { if ( eventSource . getPreInvalidationListenerCount ( ) > 0 && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "addPreInvalidationListener() cacheName=" + this . cacheName + " one already exists. Overwriting old listener." ) ; } eventSource . addListener ( listener ) ; return true ; } return false ; } | This is a helper method to add pre - invalidation listener to all entries . |
24,672 | public void disableCacheSizeInMB ( ) { this . memoryCacheSizeInMBEnabled = false ; this . cacheConfig . memoryCacheSizeInMB = - 1 ; this . currentMemoryCacheSizeInBytes = - 1 ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "disableCacheSizeInMB() cacheName=" + this . cacheName ) ; } } | Disable cache size in MB |
24,673 | public void increaseCacheSizeInBytes ( long size , String msg ) { if ( this . memoryCacheSizeInMBEnabled ) { this . currentMemoryCacheSizeInBytes += size ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "increaseCacheSizeInBytes() cacheName=" + cacheName + " " + msg + " size=" + size + " currentMemoryCacheSizeInBytes=" + this . currentMemoryCacheSizeInBytes ) ; } } } | Increase cache size in bytes to the total count |
24,674 | private boolean initEventSource ( ) { boolean success = false ; try { eventSource = ServerCache . cacheUnit . createEventSource ( cacheConfig . useListenerContext , cacheName ) ; } catch ( Exception ex ) { com . ibm . ws . ffdc . FFDCFilter . processException ( ex , "com.ibm.ws.cache.Cache.initEventSource" , "3289" , this ) ; } if ( eventSource != null ) { success = true ; } return success ; } | This is a helper method to initialize event source for invalidation listener |
24,675 | public synchronized boolean removeChangeListener ( ChangeListener listener ) { if ( bEnableListener && listener != null ) { eventSource . removeListener ( listener ) ; return true ; } return false ; } | This is a helper method to remove change listener for all entries . |
24,676 | public synchronized boolean removeInvalidationListener ( InvalidationListener listener ) { if ( bEnableListener && listener != null ) { eventSource . removeListener ( listener ) ; return true ; } return false ; } | This is a helper method to remove invalidation listener for all entries . |
24,677 | public synchronized boolean removePreInvalidationListener ( PreInvalidationListener listener ) { if ( bEnableListener && listener != null ) { eventSource . removeListener ( listener ) ; return true ; } return false ; } | This is a helper method to remove pre - invalidation listener for all entries . |
24,678 | static List < File > listProductExtensionDirectories ( ) { List < File > dirs = new ArrayList < File > ( ) ; for ( ProductExtensionInfo info : ProductExtension . getProductExtensions ( ) ) { String loc = info . getLocation ( ) ; if ( loc != null ) { File extensionDir = new File ( info . getLocation ( ) ) ; if ( ! extensionDir . isAbsolute ( ) ) { File parentDir = Utils . getInstallDir ( ) . getParentFile ( ) ; extensionDir = new File ( parentDir , info . getLocation ( ) ) ; } dirs . add ( extensionDir ) ; } } return dirs ; } | List all of product extension directory . It returns empty List object if there is no product extension . |
24,679 | static private List < LaunchManifest . RequiredBundle > findExtensionBundles ( List < File > dirs ) throws IOException { List < LaunchManifest . RequiredBundle > list = new ArrayList < LaunchManifest . RequiredBundle > ( ) ; for ( File dir : dirs ) { if ( dir . exists ( ) ) { File [ ] files = dir . listFiles ( ) ; if ( files != null ) { for ( File file : files ) { if ( ! file . isDirectory ( ) && file . getName ( ) . toLowerCase ( ) . endsWith ( ".jar" ) ) { String bundles = getRequiredBundles ( file ) ; if ( bundles != null ) { list . addAll ( LaunchManifest . parseRequireBundle ( bundles ) ) ; } } } } } } return list ; } | Find Required bundles from the manifest file underneath specified directory recursively . this method does not expect that the parameters are null . returns list of RequredBundle object . |
24,680 | static private String getRequiredBundles ( File file ) throws IOException { JarFile jar = new JarFile ( file ) ; Attributes attr = jar . getManifest ( ) . getMainAttributes ( ) ; jar . close ( ) ; return attr . getValue ( "Require-Bundle" ) ; } | find the Require - Bundle name from the specified jar file . |
24,681 | @ Generated ( value = "com.ibm.jtc.jax.tools.xjc.Driver" , date = "2014-06-11T05:49:00-04:00" , comments = "JAXB RI v2.2.3-11/28/2011 06:21 AM(foreman)-" ) public List < Listener > getListenerList ( ) { if ( listenerList == null ) { listenerList = new ArrayList < Listener > ( ) ; } return this . listenerList ; } | Gets the value of the listenerList property . |
24,682 | private void includeInAppDataChanges ( String name , Object value , int invoker ) { if ( appDataTablesPerThread ) { Thread t = Thread . currentThread ( ) ; Hashtable sht = ( Hashtable ) appDataChanges . get ( t ) ; if ( sht == null ) { sht = new Hashtable ( ) ; appDataChanges . put ( t , sht ) ; } if ( com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { if ( ! SessionManagerConfig . isHideSessionValues ( ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ invoker ] , "storing for " + getId ( ) + " prop " + name + " with value " + value + " via thread " + t ) ; } else { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ invoker ] , "storing for " + getId ( ) + " prop " + name + " via thread " + t ) ; } } sht . put ( name , value ) ; } else { appDataChanges . put ( name , value ) ; } } | Adds a session attribute to the tracked list of changed data . |
24,683 | private void recover ( Connection conn ) throws SQLException , RecoverableUnitSectionExistsException , InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "recover" , conn ) ; Statement recoveryStmt = null ; ResultSet recoveryRS = null ; try { recoveryStmt = conn . createStatement ( ) ; String queryString = "SELECT RU_ID, RUSECTION_ID, RUSECTION_DATA_INDEX, DATA" + " FROM " + _recoveryTableName + _logIdentifierString + _recoveryTableNameSuffix + " WHERE SERVER_NAME='" + _serverName + "' AND SERVICE_ID=" + _recoveryAgent . clientIdentifier ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Retrieve all rows from table using - " + queryString ) ; recoveryRS = recoveryStmt . executeQuery ( queryString ) ; while ( recoveryRS . next ( ) ) { final long ruId = recoveryRS . getLong ( 1 ) ; if ( ruId != - 1 ) { SQLRecoverableUnitImpl ru = ( SQLRecoverableUnitImpl ) _recoverableUnits . get ( ruId ) ; if ( ru == null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Creating ru with id: " + ruId ) ; ru = new SQLRecoverableUnitImpl ( this , ruId , _failureScope , true ) ; } final long sectId = recoveryRS . getLong ( 2 ) ; final int index = recoveryRS . getInt ( 3 ) ; final byte [ ] data = recoveryRS . getBytes ( 4 ) ; if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "sql tranlog: read ruId: " + ruId ) ; Tr . event ( tc , "sql tranlog: read sectionId: " + sectId ) ; Tr . event ( tc , "sql tranlog: read item: " + index ) ; Tr . event ( tc , "sql tranlog: read data: " + RLSUtils . toHexString ( data , RLSUtils . MAX_DISPLAY_BYTES ) ) ; } SQLRecoverableUnitSectionImpl sect = ( SQLRecoverableUnitSectionImpl ) ru . lookupSection ( ( int ) sectId ) ; if ( sect == null ) { sect = ( SQLRecoverableUnitSectionImpl ) ru . createSection ( ( int ) sectId , index == 0 ) ; } sect . addData ( index , data ) ; } else if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Bypass locking row with id: " + ruId ) ; } } finally { if ( recoveryRS != null && ! recoveryRS . isClosed ( ) ) recoveryRS . close ( ) ; if ( recoveryStmt != null && ! recoveryStmt . isClosed ( ) ) recoveryStmt . close ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "recover" ) ; } | Retrieves log records from the database ready for recovery processing . |
24,684 | private boolean isSQLErrorTransient ( SQLException sqlex ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "isSQLErrorTransient " , new Object [ ] { sqlex , this } ) ; boolean retryBatch = false ; int sqlErrorCode = sqlex . getErrorCode ( ) ; if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , " SQL exception:" ) ; Tr . event ( tc , " Message: " + sqlex . getMessage ( ) ) ; Tr . event ( tc , " SQLSTATE: " + sqlex . getSQLState ( ) ) ; Tr . event ( tc , " Error code: " + sqlErrorCode ) ; } for ( int transientCode : _sqlTransientErrorCodes ) { Tr . event ( tc , "Test against stored code: " + transientCode ) ; if ( transientCode == sqlErrorCode ) { Tr . event ( tc , "TRANSIENT: A connection failed but could be reestablished, retry." ) ; retryBatch = true ; break ; } } if ( ! retryBatch && sqlex instanceof BatchUpdateException ) { BatchUpdateException buex = ( BatchUpdateException ) sqlex ; Tr . event ( tc , "BatchUpdateException: Update Counts - " ) ; int [ ] updateCounts = buex . getUpdateCounts ( ) ; for ( int i = 0 ; i < updateCounts . length ; i ++ ) { Tr . event ( tc , " Statement " + i + ":" + updateCounts [ i ] ) ; } SQLException nextex = buex . getNextException ( ) ; while ( nextex != null ) { sqlErrorCode = nextex . getErrorCode ( ) ; if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , " SQL exception:" ) ; Tr . event ( tc , " Message: " + nextex . getMessage ( ) ) ; Tr . event ( tc , " SQLSTATE: " + nextex . getSQLState ( ) ) ; Tr . event ( tc , " Error code: " + sqlErrorCode ) ; } for ( int transientCode : _sqlTransientErrorCodes ) { Tr . event ( tc , "Test against stored code: " + transientCode ) ; if ( transientCode == sqlErrorCode ) { Tr . event ( tc , "TRANSIENT: A connection failed but could be reestablished, retry." ) ; retryBatch = true ; break ; } } nextex = nextex . getNextException ( ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "isSQLErrorTransient" , retryBatch ) ; return retryBatch ; } | Determine whether we have encountered a potentially transient SQL error condition . If so we can retry the SQL . |
24,685 | private boolean handleForceSectionsSQLException ( SQLException sqlex ) throws InterruptedException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "handleForceSectionsSQLException" , new java . lang . Object [ ] { sqlex , this } ) ; boolean retryBatch = true ; boolean failAndReport = false ; int batchRetries = 0 ; _nonTransientExceptionAtRuntime = sqlex ; while ( retryBatch && ! failAndReport && batchRetries < _transientRetryAttempts ) { retryBatch = sqlTransientErrorHandlingEnabled && isSQLErrorTransient ( sqlex ) ; batchRetries ++ ; if ( retryBatch ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Try to reexecute the SQL using connection from DS: " + _theDS + ", attempt number: " + batchRetries ) ; if ( _theDS != null ) { Connection conn = null ; int initialIsolation = Connection . TRANSACTION_REPEATABLE_READ ; try { conn = _theDS . getConnection ( ) ; initialIsolation = prepareConnectionForBatch ( conn ) ; takeHADBLock ( conn ) ; executeBatchStatements ( conn ) ; conn . commit ( ) ; retryBatch = false ; } catch ( SQLException sqlex2 ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "reset the sqlex to " + sqlex2 ) ; sqlex = sqlex2 ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "sleeping for " + _transientRetrySleepTime + " millisecs" ) ; Thread . sleep ( _transientRetrySleepTime ) ; } catch ( Throwable exc ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Failed got exception: " + exc ) ; for ( StackTraceElement ste : Thread . currentThread ( ) . getStackTrace ( ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , " " + ste ) ; } failAndReport = true ; _nonTransientExceptionAtRuntime = exc ; } finally { if ( conn != null ) { if ( retryBatch ) { try { conn . rollback ( ) ; } catch ( Throwable exc ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Rollback Failed, when handling ForceSections SQLException, got exception: " + exc ) ; } } try { closeConnectionAfterBatch ( conn , initialIsolation ) ; } catch ( Throwable exc ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Close Failed, when handling ForceSections SQLException, got exception: " + exc ) ; } } else if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Connection was NULL" ) ; } } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "NULL DataSource reference" ) ; failAndReport = true ; } } else failAndReport = true ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "handleForceSectionsSQLException" , failAndReport ) ; return failAndReport ; } | Attempts to replay the cached up SQL work if an error is encountered during force processing and if the error is determined to be transient . |
24,686 | private void takeHADBLock ( Connection conn ) throws SQLException , InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "takeHADBLock" , new java . lang . Object [ ] { conn , this } ) ; Statement lockingStmt = null ; ResultSet lockingRS = null ; try { lockingStmt = conn . createStatement ( ) ; String queryString = "SELECT SERVER_NAME" + " FROM " + _recoveryTableName + _logIdentifierString + _recoveryTableNameSuffix + " WHERE RU_ID=" + "-1 FOR UPDATE" ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Attempt to select the HA LOCKING ROW for UPDATE using - " + queryString ) ; lockingRS = lockingStmt . executeQuery ( queryString ) ; if ( lockingRS . next ( ) ) { String storedServerName = lockingRS . getString ( 1 ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Acquired lock on HA Lock row, stored server value is: " + storedServerName ) ; if ( _currentProcessServerName . equalsIgnoreCase ( storedServerName ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "This server OWNS the HA lock row as expected" ) ; } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "ANOTHER server OWNS the lock row - we need to mark the log as failed" ) ; Tr . audit ( tc , "WTRN0100E: " + "Another server owns the log cannot force SQL RecoveryLog " + _logName + " for server " + _serverName ) ; InternalLogException ile = new InternalLogException ( "Another server has locked the HA lock row" , null ) ; markFailed ( ile ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "takeHADBLock" , "InternalLogException" ) ; throw ile ; } } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Could not find HA Lock row" ) ; InternalLogException ile = new InternalLogException ( "Could not find the HA lock row" , null ) ; Tr . audit ( tc , "WTRN0100E: " + "Could not find HA lock row when forcing SQL RecoveryLog " + _logName + " for server " + _serverName ) ; markFailed ( ile ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "takeHADBLock" , "InternalLogException" ) ; throw ile ; } } finally { if ( lockingRS != null && ! lockingRS . isClosed ( ) ) lockingRS . close ( ) ; if ( lockingStmt != null && ! lockingStmt . isClosed ( ) ) lockingStmt . close ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "takeHADBLock" ) ; } | Takes a row lock against the database table that is being used for the recovery log . This fulfils the same role as the file locking scheme in conventional transaction logging to a filesystem . The intent is that only one server should be logging to a specific table at a time . There is sometimes a lag in peer recovery where an old server is closing down while a new server is opening the same log for peer recovery . |
24,687 | private void updateHADBLock ( Connection conn , Statement lockingStmt , ResultSet lockingRS ) throws SQLException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "updateHADBLock" , new java . lang . Object [ ] { conn , lockingStmt , lockingRS , this } ) ; if ( lockingRS . next ( ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Acquired lock on HA Lock row" ) ; String storedServerName = lockingRS . getString ( 1 ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Stored server value is: " + storedServerName ) ; if ( _currentProcessServerName . equalsIgnoreCase ( storedServerName ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "This server ALREADY OWNS the HA lock row" ) ; } else { String updateString = "UPDATE " + _recoveryTableName + _logIdentifierString + _recoveryTableNameSuffix + " SET SERVER_NAME = '" + _currentProcessServerName + "' WHERE RU_ID = -1" ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "ANOTHER server OWNS the lock, lets update it using - " + updateString ) ; int ret = lockingStmt . executeUpdate ( updateString ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Have updated HA Lock row with return: " + ret ) ; } } else { short serviceId = ( short ) 1 ; String insertString = "INSERT INTO " + _recoveryTableName + _logIdentifierString + _recoveryTableNameSuffix + " (SERVER_NAME, SERVICE_ID, RU_ID, RUSECTION_ID, RUSECTION_DATA_INDEX, DATA)" + " VALUES (?,?,?,?,?,?)" ; PreparedStatement specStatement = null ; try { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Need to setup HA Lock row using - " + insertString ) ; specStatement = conn . prepareStatement ( insertString ) ; specStatement . setString ( 1 , _currentProcessServerName ) ; specStatement . setShort ( 2 , serviceId ) ; specStatement . setLong ( 3 , - 1 ) ; specStatement . setLong ( 4 , 1 ) ; specStatement . setShort ( 5 , ( short ) 1 ) ; byte buf [ ] = new byte [ 2 ] ; specStatement . setBytes ( 6 , buf ) ; int ret = specStatement . executeUpdate ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Have inserted HA Lock row with return: " + ret ) ; } finally { if ( specStatement != null && ! specStatement . isClosed ( ) ) specStatement . close ( ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "updateHADBLock" ) ; } | Acquires ownership of the special row used in the HA locking scheme . There is sometimes a lag in peer recovery where an old server is closing down while a new server is opening the same log for peer recovery . |
24,688 | private Integer getTransientSQLErrorRetryAttempts ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getTransientSQLErrorRetryAttempts" ) ; Integer transientSqlRetryAttempts = null ; try { transientSqlRetryAttempts = AccessController . doPrivileged ( new PrivilegedExceptionAction < Integer > ( ) { public Integer run ( ) { return Integer . getInteger ( "com.ibm.ws.recoverylog.custom.jdbc.impl.TransientRetryAttempts" , DEFAULT_TRANSIENT_RETRY_ATTEMPTS ) ; } } ) ; } catch ( PrivilegedActionException e ) { FFDCFilter . processException ( e , "com.ibm.ws.recoverylog.custom.jdbc.impl.SqlMultiScopeRecoveryLog.getTransientSQLErrorRetryAttempts" , "132" ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception setting transient SQL retry attempts" , e ) ; transientSqlRetryAttempts = null ; } if ( transientSqlRetryAttempts == null ) transientSqlRetryAttempts = Integer . valueOf ( DEFAULT_TRANSIENT_RETRY_ATTEMPTS ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getTransientSQLErrorRetryAttempts" , transientSqlRetryAttempts ) ; return transientSqlRetryAttempts ; } | This method retrieves a system property named com . ibm . ws . recoverylog . custom . jdbc . impl . TransientRetryAttempts which allows a value to be specified for the number of times that we should try to get a connection and retry SQL work in the face of transient sql error conditions . |
24,689 | private Integer getTransientSQLErrorRetrySleepTime ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getTransientSQLErrorRetrySleepTime" ) ; Integer transientSqlRetrySleepTime = null ; try { transientSqlRetrySleepTime = AccessController . doPrivileged ( new PrivilegedExceptionAction < Integer > ( ) { public Integer run ( ) { return Integer . getInteger ( "com.ibm.ws.recoverylog.custom.jdbc.impl.TransientRetrySleepTime" , DEFAULT_TRANSIENT_RETRY_SLEEP_TIME ) ; } } ) ; } catch ( PrivilegedActionException e ) { FFDCFilter . processException ( e , "com.ibm.ws.recoverylog.custom.jdbc.impl.SqlMultiScopeRecoveryLog.getTransientSQLErrorRetrySleepTime" , "132" ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception setting transient SQL retry sleep time" , e ) ; transientSqlRetrySleepTime = null ; } if ( transientSqlRetrySleepTime == null ) transientSqlRetrySleepTime = Integer . valueOf ( DEFAULT_TRANSIENT_RETRY_SLEEP_TIME ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getTransientSQLErrorRetrySleepTime" , transientSqlRetrySleepTime ) ; return transientSqlRetrySleepTime ; } | This method retrieves a system property named com . ibm . ws . recoverylog . custom . jdbc . impl . TransientRetrySleepTime which allows a value to be specified for the time we should sleep between attempts to get a connection and retry SQL work in the face of transient sql error conditions . |
24,690 | public void provideServiceability ( ) { Exception e = new Exception ( ) ; try { FFDCFilter . processException ( e , "com.ibm.ws.recoverylog.custom.jdbc.impl.SQLMultiScopeRecoveryLog.provideServiceability" , "3624" , this ) ; HashMap < Long , RecoverableUnit > rus = _recoverableUnits ; if ( rus != null ) FFDCFilter . processException ( e , "com.ibm.ws.recoverylog.custom.jdbc.impl.SQLMultiScopeRecoveryLog.provideServiceability" , "3628" , rus ) ; } catch ( Exception ex ) { } } | Called when logs fail . Provides more comprehensive FFDC - PI45254 . this is NOT synchronized to avoid deadlocks . |
24,691 | private int prepareConnectionForBatch ( Connection conn ) throws SQLException { conn . setAutoCommit ( false ) ; int initialIsolation = Connection . TRANSACTION_REPEATABLE_READ ; if ( _isDB2 ) { try { initialIsolation = conn . getTransactionIsolation ( ) ; if ( Connection . TRANSACTION_REPEATABLE_READ != initialIsolation && Connection . TRANSACTION_SERIALIZABLE != initialIsolation ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Transaction isolation level was " + initialIsolation + " , setting to TRANSACTION_REPEATABLE_READ" ) ; conn . setTransactionIsolation ( Connection . TRANSACTION_REPEATABLE_READ ) ; } } catch ( Exception e ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setTransactionIsolation to RR threw Exception. Transaction isolation level was " + initialIsolation + " " , e ) ; FFDCFilter . processException ( e , "com.ibm.ws.recoverylog.spi.SQLMultiScopeRecoveryLog.prepareConnectionForBatch" , "3668" , this ) ; if ( ! isolationFailureReported ) { isolationFailureReported = true ; Tr . warning ( tc , "CWRLS0024_EXC_DURING_RECOVERY" , e ) ; } initialIsolation = Connection . TRANSACTION_REPEATABLE_READ ; } } return initialIsolation ; } | Sets AutoCommit and Isolation level for the connection |
24,692 | private void closeConnectionAfterBatch ( Connection conn , int initialIsolation ) throws SQLException { if ( _isDB2 ) { if ( Connection . TRANSACTION_REPEATABLE_READ != initialIsolation && Connection . TRANSACTION_SERIALIZABLE != initialIsolation ) try { conn . setTransactionIsolation ( initialIsolation ) ; } catch ( Exception e ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setTransactionIsolation threw Exception. Specified transaction isolation level was " + initialIsolation + " " , e ) ; FFDCFilter . processException ( e , "com.ibm.ws.recoverylog.spi.SQLMultiScopeRecoveryLog.closeConnectionAfterBatch" , "3696" , this ) ; if ( ! isolationFailureReported ) { isolationFailureReported = true ; Tr . warning ( tc , "CWRLS0024_EXC_DURING_RECOVERY" , e ) ; } } } conn . close ( ) ; } | closes the connection and resets the isolation level if required |
24,693 | public static String extractRegexGroup ( String fromContent , String regex ) throws Exception { return extractRegexGroup ( fromContent , regex , 1 ) ; } | Extracts the first matching group in the provided content if the regex includes at least one group . An exception is thrown if the regex does not include a group or if a matching group cannot be found in the content . |
24,694 | public static void changedPropertyValue ( String name , String value ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "changedPropertyValue" ) ; if ( value == null ) value = "null" ; if ( ! value . equals ( seenProperties . put ( name , value ) ) ) { SibTr . info ( tc , "RUNTIME_CWSIU0001" , new Object [ ] { name , value } ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "changedPropertyValue" ) ; } | This method should be called each time a SIB property value is assigned a none default value . An informational message is output for serviceability reasons so that it is obvious that a property value has been changed . |
24,695 | public static DERUTCTime getInstance ( Object obj ) { if ( obj == null || obj instanceof DERUTCTime ) { return ( DERUTCTime ) obj ; } if ( obj instanceof ASN1OctetString ) { return new DERUTCTime ( ( ( ASN1OctetString ) obj ) . getOctets ( ) ) ; } throw new IllegalArgumentException ( "illegal object in getInstance: " + obj . getClass ( ) . getName ( ) ) ; } | return an UTC Time from the passed in object . |
24,696 | static void saveSchemas ( MessageStore msgStore , JMFSchema [ ] schemas ) throws MessageEncodeFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "saveSchemas" ) ; try { SchemaStoreItemStream schemaStore = getSchemaStore ( msgStore ) ; for ( int i = 0 ; i < schemas . length ; i ++ ) { if ( ! schemaStore . containsSchema ( schemas [ i ] . getLongID ( ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Saving schema:" + schemas [ i ] . getID ( ) ) ; schemaStore . addSchema ( schemas [ i ] , msgStore . getTransactionFactory ( ) . createAutoCommitTransaction ( ) ) ; } } } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "saveSchemas" , "83" ) ; throw new MessageEncodeFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "saveSchemas" ) ; } | already held in the SchemaStore for that ME are added . |
24,697 | static void loadSchemas ( MessageStore msgStore , long [ ] schemaIds ) throws MessageRestoreFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "loadSchemas" ) ; try { SchemaStoreItemStream schemaStore = getSchemaStore ( msgStore ) ; for ( int i = 0 ; i < schemaIds . length ; i ++ ) { if ( JMFRegistry . instance . retrieve ( schemaIds [ i ] ) == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Restoring schema:" + schemaIds [ i ] ) ; JMFRegistry . instance . register ( schemaStore . findSchema ( schemaIds [ i ] ) ) ; } } } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "loadSchemas" , "105" ) ; throw new MessageRestoreFailedException ( e ) ; } catch ( JMFException e ) { FFDCFilter . processException ( e , "loadSchemas" , "108" ) ; throw new MessageRestoreFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "loadSchemas" ) ; } | decode the message that are not already in the JMF registry must be reloaded |
24,698 | private static SchemaStoreItemStream getSchemaStore ( MessageStore msgStore ) throws MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getSchemaStore" ) ; SchemaStoreItemStream store = schemaStores . get ( msgStore ) ; if ( store == null ) { Filter filter = new Filter ( ) { public boolean filterMatches ( AbstractItem item ) { return ( item instanceof SchemaStoreItemStream ) ; } } ; store = ( SchemaStoreItemStream ) msgStore . findFirstMatching ( filter ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) && store != null ) SibTr . debug ( tc , "Schema store found in message store" ) ; if ( store == null ) { store = new SchemaStoreItemStream ( ) ; msgStore . add ( store , msgStore . getTransactionFactory ( ) . createAutoCommitTransaction ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "New schema store created" ) ; } schemaStores . put ( msgStore , store ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getSchemaStore" ) ; return store ; } | SchemaStore for a particular ME . |
24,699 | public JsMessage getJsMessage ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getJsMessage" ) ; InvalidOperationException finalE = new InvalidOperationException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0005" , new Object [ ] { "RemoteMessageRequest.getJsMessage" , "1:127:1.34" , this } , null ) ) ; SibTr . exception ( tc , finalE ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getJsMessage" ) ; throw finalE ; } | No - op as the JsMessage is not present in the stream on the RME . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.