idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
25,000 | public static final long computeHashCode ( String str , boolean modifyAlgorithm ) { char chars [ ] = str . toCharArray ( ) ; long h = initial_hash ; for ( int i = 0 ; i < chars . length ; ++ i ) { char thisChar = chars [ i ] ; if ( modifyAlgorithm ) { int j = i ; while ( j > 0 ) { if ( j >= 64 && thisChar == chars [ j - 64 ] ) { thisChar ^= mix_master [ thisChar & 0xff ] ; } j -= 64 ; } } h = ( ( h << 1 ) | ( h >>> 63 ) ) ^ mix_master [ thisChar & 0xff ] ; } return h ; } | are the same . |
25,001 | public void addPhaseListener ( PhaseListener phaseListener ) { if ( phaseListener == null ) { throw new NullPointerException ( "phaseListener" ) ; } getStateHelper ( ) . add ( PropertyKeys . phaseListeners , phaseListener ) ; } | Adds a The phaseListeners attached to ViewRoot . |
25,002 | @ JSFProperty ( returnSignature = "void" , methodSignature = "javax.faces.event.PhaseEvent" , jspName = "afterPhase" , stateHolder = true ) public MethodExpression getAfterPhaseListener ( ) { return ( MethodExpression ) getStateHelper ( ) . eval ( PropertyKeys . afterPhaseListener ) ; } | MethodBinding pointing to a method that takes a javax . faces . event . PhaseEvent and returns void called after every phase except for restore view . |
25,003 | @ JSFProperty ( returnSignature = "void" , methodSignature = "javax.faces.event.PhaseEvent" , jspName = "beforePhase" , stateHolder = true ) public MethodExpression getBeforePhaseListener ( ) { return ( MethodExpression ) getStateHelper ( ) . eval ( PropertyKeys . beforePhaseListener ) ; } | MethodBinding pointing to a method that takes a javax . faces . event . PhaseEvent and returns void called before every phase except for restore view . |
25,004 | private boolean _broadcastAll ( FacesContext context , List < ? extends FacesEvent > events , Collection < FacesEvent > eventsAborted ) { assert events != null ; for ( int i = 0 ; i < events . size ( ) ; i ++ ) { FacesEvent event = events . get ( i ) ; UIComponent source = event . getComponent ( ) ; UIComponent compositeParent = UIComponent . getCompositeComponentParent ( source ) ; if ( compositeParent != null ) { pushComponentToEL ( context , compositeParent ) ; } pushComponentToEL ( context , source ) ; try { if ( ! source . isCachedFacesContext ( ) ) { try { source . setCachedFacesContext ( context ) ; source . broadcast ( event ) ; } finally { source . setCachedFacesContext ( null ) ; } } else { source . broadcast ( event ) ; } } catch ( Exception e ) { Throwable cause = e ; AbortProcessingException ape = null ; do { if ( cause != null && cause instanceof AbortProcessingException ) { ape = ( AbortProcessingException ) cause ; break ; } cause = cause . getCause ( ) ; } while ( cause != null ) ; if ( ape != null ) { e = ape ; } ExceptionQueuedEventContext exceptionContext = new ExceptionQueuedEventContext ( context , e , source , context . getCurrentPhaseId ( ) ) ; context . getApplication ( ) . publishEvent ( context , ExceptionQueuedEvent . class , exceptionContext ) ; if ( ape != null ) { eventsAborted . add ( event ) ; } else { return false ; } } finally { source . popComponentFromEL ( context ) ; if ( compositeParent != null ) { compositeParent . popComponentFromEL ( context ) ; } } } return true ; } | Broadcast all events in the specified collection stopping the at any time an AbortProcessingException is thrown . |
25,005 | public void removePhaseListener ( PhaseListener phaseListener ) { if ( phaseListener == null ) { return ; } getStateHelper ( ) . remove ( PropertyKeys . phaseListeners , phaseListener ) ; } | Removes a The phaseListeners attached to ViewRoot . |
25,006 | private boolean _process ( FacesContext context , PhaseId phaseId , PhaseProcessor processor ) { RuntimeException processingException = null ; try { if ( ! notifyListeners ( context , phaseId , getBeforePhaseListener ( ) , true ) ) { try { if ( processor != null ) { processor . process ( context , this ) ; } broadcastEvents ( context , phaseId ) ; } catch ( RuntimeException re ) { processingException = re ; } } } finally { if ( context . getRenderResponse ( ) || context . getResponseComplete ( ) ) { clearEvents ( ) ; } } boolean retVal = notifyListeners ( context , phaseId , getAfterPhaseListener ( ) , false ) ; if ( processingException == null ) { return retVal ; } else { throw processingException ; } } | Process the specified phase by calling PhaseListener . beforePhase for every phase listeners defined on this view root then calling the process method of the processor broadcasting relevant events and finally notifying the afterPhase method of every phase listeners registered on this view root . |
25,007 | private Events _getEvents ( PhaseId phaseId ) { int size = _events . size ( ) ; List < FacesEvent > anyPhase = new ArrayList < FacesEvent > ( size ) ; List < FacesEvent > onPhase = new ArrayList < FacesEvent > ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { FacesEvent event = _events . get ( i ) ; if ( event . getPhaseId ( ) . equals ( PhaseId . ANY_PHASE ) ) { anyPhase . add ( event ) ; _events . remove ( i ) ; size -- ; i -- ; } else if ( event . getPhaseId ( ) . equals ( phaseId ) ) { onPhase . add ( event ) ; _events . remove ( i ) ; size -- ; i -- ; } } return new Events ( anyPhase , onPhase ) ; } | Gathers all event for current and ANY phase |
25,008 | private boolean getClause ( Iterator tokens , List clause ) { while ( tokens . hasNext ( ) ) { Object token = tokens . next ( ) ; if ( token == matchMany ) return true ; clause . add ( token ) ; } return false ; } | matchMany false if it was ended by running out of tokens . |
25,009 | boolean checkPrefix ( char [ ] chars , int [ ] cursor ) { if ( prefix == null ) return true ; else return matchClause ( prefix , chars , cursor ) ; } | Internal method to evaluate a candidate against the prefix |
25,010 | static boolean matchForward ( char [ ] chars , char [ ] pattern , int [ ] cursor ) { if ( pattern . length > cursor [ 1 ] - cursor [ 0 ] ) return false ; int index = 0 ; while ( index < pattern . length ) if ( chars [ cursor [ 0 ] ++ ] != pattern [ index ++ ] ) return false ; return true ; } | Match characters in a forward direction |
25,011 | boolean checkSuffix ( char [ ] chars , int [ ] cursor ) { if ( suffix == null ) return true ; int start = cursor [ 1 ] - suffix . minlen ; if ( start < cursor [ 0 ] ) return false ; if ( ! matchClause ( suffix , chars , new int [ ] { start , cursor [ 1 ] } ) ) return false ; cursor [ 1 ] = start ; return true ; } | Internal method to evaluate a candidate against the suffix |
25,012 | public boolean matchMiddle ( char [ ] chars , int start , int end ) { if ( midClauses == null ) return true ; int [ ] cursor = new int [ ] { start , end } ; for ( int i = 0 ; i < midClauses . length ; i ++ ) { Clause clause = midClauses [ i ] ; if ( ! find ( clause , chars , cursor ) ) return false ; } return true ; } | Match a sequence of characters against the midClauses of this pattern |
25,013 | private boolean find ( Clause clause , char [ ] chars , int [ ] cursor ) { int start = cursor [ 0 ] ; int end = cursor [ 1 ] ; while ( end - start >= clause . minlen ) if ( matchClause ( clause , chars , cursor ) ) return true ; else cursor [ 0 ] = ++ start ; return false ; } | the end of the found portion . |
25,014 | public static Object parsePattern ( String pattern , boolean escaped , char escape ) { char [ ] accum = new char [ pattern . length ( ) ] ; int finger = 0 ; List tokens = new ArrayList ( ) ; boolean trivial = true ; for ( int i = 0 ; i < pattern . length ( ) ; i ++ ) { char c = pattern . charAt ( i ) ; if ( c == sqlMatchOne ) { finger = flush ( accum , finger , tokens ) ; tokens . add ( matchOne ) ; trivial = false ; } else if ( c == sqlMatchMany ) { finger = flush ( accum , finger , tokens ) ; tokens . add ( matchMany ) ; trivial = false ; } else if ( escaped && c == escape ) if ( i == pattern . length ( ) - 1 ) return null ; else { i ++ ; accum [ finger ++ ] = pattern . charAt ( i ) ; } else accum [ finger ++ ] = c ; } if ( trivial ) return new String ( accum , 0 , finger ) ; flush ( accum , finger , tokens ) ; if ( tokens . size ( ) == 1 && tokens . get ( 0 ) == matchMany ) return matchMany ; return new Pattern ( tokens . iterator ( ) ) ; } | Parse a string containing a SQL - style pattern |
25,015 | public VirtualConnection write ( long numBytes , TCPWriteCompletedCallback writeCallback , boolean forceQueue , int timeout ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "write(" + numBytes + ",..," + forceQueue + "," + timeout + ")" ) ; } getTCPConnLink ( ) . incrementNumWrites ( ) ; if ( getConfig ( ) . getDumpStatsInterval ( ) > 0 ) { getTCPConnLink ( ) . getTCPChannel ( ) . totalAsyncWrites . incrementAndGet ( ) ; } checkForErrors ( numBytes , true , timeout ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Socket socket = getTCPConnLink ( ) . getSocketIOChannel ( ) . getSocket ( ) ; Tr . event ( tc , "write (async) requested for local: " + socket . getLocalSocketAddress ( ) + " remote: " + socket . getRemoteSocketAddress ( ) ) ; } VirtualConnection vc = null ; if ( isAborted ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Previously aborted, unable to perform write" ) ; } if ( null != writeCallback ) { IOException ioe = new IOException ( "Connection aborted by program" ) ; writeCallback . error ( getTCPConnLink ( ) . getVirtualConnection ( ) , this , ioe ) ; } } else { vc = writeInternal ( numBytes , writeCallback , forceQueue , timeout ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "write: " + vc ) ; } return vc ; } | external async write |
25,016 | protected VirtualConnection writeInternal ( long numBytes , TCPWriteCompletedCallback writeCallback , boolean forceQueue , int time ) { int timeout = time ; if ( timeout == IMMED_TIMEOUT ) { immediateTimeout ( ) ; return null ; } else if ( timeout == ABORT_TIMEOUT ) { abort ( ) ; immediateTimeout ( ) ; return null ; } if ( timeout == TCPRequestContext . USE_CHANNEL_TIMEOUT ) { timeout = getConfig ( ) . getInactivityTimeout ( ) ; } setIOAmount ( numBytes ) ; setLastIOAmt ( 0 ) ; setIODoneAmount ( 0 ) ; setWriteCompletedCallback ( writeCallback ) ; setForceQueue ( forceQueue ) ; setTimeoutTime ( timeout ) ; return processAsyncWriteRequest ( ) ; } | internal async write |
25,017 | public ByteBuffer preProcessOneWriteBuffer ( ) { WsByteBufferImpl wsBuffImpl = null ; try { wsBuffImpl = ( WsByteBufferImpl ) getBuffer ( ) ; } catch ( ClassCastException cce ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Writing with a non-WsByteBufferImpl" ) ; } return getBuffer ( ) . getWrappedByteBuffer ( ) ; } if ( ! wsBuffImpl . isDirect ( ) && wsBuffImpl . hasArray ( ) ) { wsBuffImpl . copyToDirectBuffer ( ) ; return wsBuffImpl . oWsBBDirect ; } return wsBuffImpl . getWrappedByteBufferNonSafe ( ) ; } | Before attempting a write of one buffer perform any work required and return the proper NIO buffer to write out . |
25,018 | public void postProcessWriteBuffers ( long dataWritten ) { if ( getByteBufferArrayDirect ( ) == null ) { try { if ( ( ( WsByteBufferImpl ) getBuffer ( ) ) . oWsBBDirect != null ) { ( ( WsByteBufferImpl ) getBuffer ( ) ) . setParmsFromDirectBuffer ( ) ; } } catch ( ClassCastException cce ) { } return ; } WsByteBuffer wsBuffArray [ ] = getBuffers ( ) ; for ( int i = 0 ; i < wsBuffArray . length ; i ++ ) { if ( wsBuffArray [ i ] == null ) { break ; } try { ( ( WsByteBufferImpl ) wsBuffArray [ i ] ) . setParmsFromDirectBuffer ( ) ; } catch ( ClassCastException cce ) { return ; } } } | After the write call perform any actions required on the write buffers . |
25,019 | protected WeldCreationalContext < T > getCreationalContext ( ManagedObjectInvocationContext < T > invocationContext ) throws ManagedObjectException { ManagedObjectContext managedObjectContext = invocationContext . getManagedObjectContext ( ) ; @ SuppressWarnings ( "unchecked" ) WeldCreationalContext < T > creationalContext = managedObjectContext . getContextData ( WeldCreationalContext . class ) ; creationalContext = CreationalContextResolver . resolve ( creationalContext , getBean ( ) ) ; return creationalContext ; } | Get the CreationalContext from an existing ManagedObjectInvocationContext |
25,020 | public MessageMap getMap ( BigInteger index ) { if ( array != null ) return array [ index . intValue ( ) ] ; else return ( MessageMap ) hashtable . get ( index ) ; } | Get an element from the table |
25,021 | public void set ( MessageMap value ) { if ( array != null ) array [ value . multiChoice . intValue ( ) ] = value ; else hashtable . put ( value . multiChoice , value ) ; } | Set an element into the table |
25,022 | public H2StreamProcessor startNewInboundSession ( Integer streamID ) { H2StreamProcessor h2s = null ; h2s = muxLink . createNewInboundLink ( streamID ) ; return h2s ; } | of the http1 . 1 HttpInboundLink . HttpInboundLink is wrapped by the H2HttpInboundLinkWrap that the new stream has access to . |
25,023 | public void fireEvent ( final InvalidationEvent event ) { if ( bUpdateInvalidationListener ) { synchronized ( hsInvalidationListeners ) { if ( invalidationListenerCount > 0 ) { currentInvalidationListeners = new InvalidationListener [ invalidationListenerCount ] ; hsInvalidationListeners . toArray ( currentInvalidationListeners ) ; } else { currentInvalidationListeners = EMPTY_INV_LISTENERS ; } bUpdateInvalidationListener = false ; } } try { event . m_cacheName = this . cacheNameNonPrefixed ; for ( int i = 0 ; i < currentInvalidationListeners . length ; i ++ ) { final InvalidationListener currentIL = currentInvalidationListeners [ i ] ; if ( _async ) { Scheduler . submit ( new Runnable ( ) { public void run ( ) { currentIL . fireEvent ( event ) ; } } ) ; } else { currentIL . fireEvent ( event ) ; } } } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.DCEventSource.fireEvent" , "85" , this ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception thrown in fireEvent method of InvalidationListener\n" + t . toString ( ) ) ; } } } | The listeners are called when the fireEvent method is invoked . |
25,024 | public void addListener ( InvalidationListener listener ) { synchronized ( hsInvalidationListeners ) { hsInvalidationListeners . add ( listener ) ; invalidationListenerCount = hsInvalidationListeners . size ( ) ; bUpdateInvalidationListener = true ; } } | This adds a new listener to the Invalidation listener . |
25,025 | public void removeListener ( InvalidationListener listener ) { synchronized ( hsInvalidationListeners ) { hsInvalidationListeners . remove ( listener ) ; invalidationListenerCount = hsInvalidationListeners . size ( ) ; bUpdateInvalidationListener = true ; } } | This removes a specified listener for Invalidation listener . If it was not already registered then this call is ignored . |
25,026 | public boolean shouldInvalidate ( Object id , int sourceOfInvalidation , int causeOfInvalidation ) { boolean retVal = true ; if ( preInvalidationListenerCount > 0 ) { try { retVal = currentPreInvalidationListener . shouldInvalidate ( id , sourceOfInvalidation , causeOfInvalidation ) ; } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.DCEventSource.shouldInvalidate" , "120" , this ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception thrown in shouldInvalidate method of PreInvalidationListener\n" + t . toString ( ) ) ; } } } return retVal ; } | The listeners are called when the preInvalidate method is invoked . |
25,027 | public void addListener ( PreInvalidationListener listener ) { if ( preInvalidationListenerCount == 1 && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Over-writing current PreInvalidationListener with new one" ) ; currentPreInvalidationListener = listener ; preInvalidationListenerCount = 1 ; } | This adds a new listener to the PreInvalidation listener . |
25,028 | public void cacheEntryChanged ( final ChangeEvent event ) { if ( bUpdateChangeListener ) { synchronized ( hsChangeListeners ) { if ( changeListenerCount > 0 ) { currentChangeListeners = new ChangeListener [ changeListenerCount ] ; hsChangeListeners . toArray ( currentChangeListeners ) ; } else { currentChangeListeners = EMPTY_CHANGE_LISTENERS ; } bUpdateChangeListener = false ; } } try { event . m_cacheName = this . cacheNameNonPrefixed ; for ( int i = 0 ; i < currentChangeListeners . length ; i ++ ) { final ChangeListener cl = currentChangeListeners [ i ] ; if ( _async ) { Scheduler . submit ( new Runnable ( ) { public void run ( ) { cl . cacheEntryChanged ( event ) ; } } ) ; } else { cl . cacheEntryChanged ( event ) ; } } } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.DCEventSource.cacheEntryChanged" , "169" , this ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception thrown in cacheEntryChanged method of ChangeListener\n" + t . toString ( ) ) ; } } } | The listeners are called when the cacheEntryChange method is invoked . |
25,029 | public void addListener ( ChangeListener listener ) { synchronized ( hsChangeListeners ) { hsChangeListeners . add ( listener ) ; changeListenerCount = hsChangeListeners . size ( ) ; bUpdateChangeListener = true ; } } | This adds a new change listener to the Change listener . |
25,030 | public void removeListener ( ChangeListener listener ) { synchronized ( hsChangeListeners ) { hsChangeListeners . remove ( listener ) ; changeListenerCount = hsChangeListeners . size ( ) ; bUpdateChangeListener = true ; } } | This removes a specified listener for the Change listener . If it was not already registered then this call is ignored . |
25,031 | public ServerBuilder addProductExtension ( String name , Properties props ) { if ( ( name != null ) && ( props != null ) ) { if ( productExtensions == null ) { productExtensions = new HashMap < String , Properties > ( ) ; } this . productExtensions . put ( name , props ) ; } return this ; } | Add a product extension . |
25,032 | public List < com . ibm . wsspi . security . wim . model . SortKeyType > getSortKeys ( ) { if ( sortKeys == null ) { sortKeys = new ArrayList < com . ibm . wsspi . security . wim . model . SortKeyType > ( ) ; } return this . sortKeys ; } | Gets the value of the sortKeys property . |
25,033 | private final Map < String , Object > appendStateComparison ( StringBuilder sb , TaskState state , boolean inState ) { Map < String , Object > params = new HashMap < String , Object > ( ) ; switch ( state ) { case SCHEDULED : sb . append ( "t.STATES" ) . append ( inState ? "<" : ">=" ) . append ( ":s" ) ; params . put ( "s" , TaskState . SUSPENDED . bit ) ; break ; case SUSPENDED : sb . append ( inState ? "t.STATES>=:s1 AND t.STATES<:s2" : "(t.STATES<:s1 OR t.STATES>=:s2)" ) ; params . put ( "s1" , TaskState . SUSPENDED . bit ) ; params . put ( "s2" , TaskState . ENDED . bit ) ; break ; case ENDED : case CANCELED : sb . append ( "t.STATES" ) . append ( inState ? ">=" : "<" ) . append ( ":s" ) ; params . put ( "s" , state . bit ) ; break ; case SUCCESSFUL : sb . append ( inState ? "t.STATES>=:s1 AND t.STATES<:s2" : "(t.STATES<:s1 OR t.STATES>=:s2)" ) ; params . put ( "s1" , TaskState . SUCCESSFUL . bit ) ; params . put ( "s2" , TaskState . FAILURE_LIMIT_REACHED . bit ) ; break ; case FAILURE_LIMIT_REACHED : sb . append ( inState ? "t.STATES>=:s1 AND t.STATES<:s2" : "(t.STATES<:s1 OR t.STATES>=:s2)" ) ; params . put ( "s1" , TaskState . FAILURE_LIMIT_REACHED . bit ) ; params . put ( "s2" , TaskState . CANCELED . bit ) ; break ; default : sb . append ( "MOD(t.STATES,:s*2)" ) . append ( inState ? ">=" : "<" ) . append ( ":s" ) ; params . put ( "s" , state . bit ) ; } return params ; } | Appends conditions to a JPA query to filter based on the presence or absence of the specified state . This method optimizes to avoid the MOD function if possible . |
25,034 | public boolean cancel ( long taskId ) throws Exception { StringBuilder update = new StringBuilder ( 87 ) . append ( "UPDATE Task t SET t.STATES=" ) . append ( TaskState . CANCELED . bit + TaskState . ENDED . bit ) . append ( ",t.VERSION=t.VERSION+1 WHERE t.ID=:i AND t.STATES<" ) . append ( TaskState . ENDED . bit ) ; final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "cancel" , taskId , update ) ; EntityManager em = getPersistenceServiceUnit ( ) . createEntityManager ( ) ; try { Query query = em . createQuery ( update . toString ( ) ) ; query . setParameter ( "i" , taskId ) ; boolean canceled = query . executeUpdate ( ) > 0 ; if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "cancel" , canceled ) ; return canceled ; } finally { em . close ( ) ; } } | Update the record for a task in the persistent store to indicate that the task is canceled . |
25,035 | public void create ( TaskRecord taskRecord ) throws Exception { Task task = new Task ( taskRecord ) ; EntityManager em = getPersistenceServiceUnit ( ) . createEntityManager ( ) ; try { em . persist ( task ) ; em . flush ( ) ; taskRecord . setId ( task . ID ) ; } finally { em . close ( ) ; } } | Create an entry in the persistent store for a new task . |
25,036 | @ FFDCIgnore ( { EntityExistsException . class , PersistenceException . class , Exception . class } ) public boolean createProperty ( String name , String value ) throws Exception { EntityManager em = getPersistenceServiceUnit ( ) . createEntityManager ( ) ; Property property = new Property ( name , value ) ; try { em . persist ( property ) ; em . flush ( ) ; } catch ( EntityExistsException x ) { return false ; } catch ( PersistenceException x ) { if ( x . getCause ( ) instanceof SQLIntegrityConstraintViolationException ) { return false ; } try { em . detach ( property ) ; if ( em . find ( Property . class , name ) != null ) { return false ; } } catch ( Exception ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "createProperty" , ex ) ; } FFDCFilter . processException ( x , getClass ( ) . getName ( ) , "309" , this ) ; throw x ; } finally { em . close ( ) ; } return true ; } | Create a property entry in the persistent store . |
25,037 | public final PersistenceServiceUnit getPersistenceServiceUnit ( ) throws Exception { lock . readLock ( ) . lock ( ) ; try { if ( destroyed ) throw new IllegalStateException ( ) ; if ( persistenceServiceUnit == null ) { lock . readLock ( ) . unlock ( ) ; lock . writeLock ( ) . lock ( ) ; try { if ( destroyed ) throw new IllegalStateException ( ) ; if ( persistenceServiceUnit == null ) persistenceServiceUnit = dbStore . createPersistenceServiceUnit ( priv . getClassLoader ( Task . class ) , Partition . class . getName ( ) , Property . class . getName ( ) , Task . class . getName ( ) ) ; } finally { lock . readLock ( ) . lock ( ) ; lock . writeLock ( ) . unlock ( ) ; } } return persistenceServiceUnit ; } finally { lock . readLock ( ) . unlock ( ) ; } } | Returns the persistence service unit lazily initializing if necessary . |
25,038 | public void combine ( WSStatistic otherStat ) { if ( ! validate ( otherStat ) ) return ; AverageStatisticImpl other = ( AverageStatisticImpl ) otherStat ; boolean previousCountWasZero = ( count == 0 ) ; count += other . count ; total += other . total ; sumOfSquares += other . sumOfSquares ; if ( other . count != 0 && ( min > other . min || previousCountWasZero == true ) ) min = other . min ; if ( max < other . max ) max = other . max ; if ( other . lastSampleTime > lastSampleTime ) lastSampleTime = other . lastSampleTime ; } | Combine this StatData with other StatData |
25,039 | public synchronized boolean next ( long seqNum ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "next" , new Long ( seqNum ) ) ; expiryAlarmHandle . cancel ( ) ; expiryAlarmHandle = am . create ( parent . getMessageProcessor ( ) . getCustomProperties ( ) . get_browse_expiry_timeout ( ) , this ) ; if ( closed ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "next" , new Boolean ( closed ) ) ; return true ; } if ( seqNum == expectedSequenceNumber ) { try { JsMessage msg = browseCursor . next ( ) ; if ( msg != null ) { parent . sendBrowseData ( msg , remoteMEUuid , gatheringTargetDestUuid , key . getRemoteMEUuid ( ) , key . getBrowseId ( ) , expectedSequenceNumber ) ; expectedSequenceNumber ++ ; } else { parent . sendBrowseEnd ( remoteMEUuid , gatheringTargetDestUuid , key . getBrowseId ( ) , SIMPConstants . BROWSE_OK ) ; close ( ) ; } } catch ( SIException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.AOBrowserSession.next" , "1:182:1.30" , this ) ; Exception e2 = new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.AOBrowserSession" , "1:190:1.30" , e } , null ) , e ) ; SibTr . exception ( tc , e2 ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.AOBrowserSession" , "1:199:1.30" , e } ) ; parent . sendBrowseEnd ( remoteMEUuid , gatheringTargetDestUuid , key . getBrowseId ( ) , SIMPConstants . BROWSE_STORE_EXCEPTION ) ; close ( ) ; } } else { parent . sendBrowseEnd ( remoteMEUuid , gatheringTargetDestUuid , key . getBrowseId ( ) , SIMPConstants . BROWSE_OUT_OF_ORDER ) ; close ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "next" , new Boolean ( closed ) ) ; return closed ; } | Send the next message in this session to the remote ME . |
25,040 | public synchronized final void close ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "close" ) ; closed = true ; if ( browseCursor != null ) { try { browseCursor . finished ( ) ; } catch ( SISessionDroppedException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.AOBrowserSession.close" , "1:237:1.30" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.AOBrowserSession.close" , "1:244:1.30" , SIMPUtils . getStackTrace ( e ) } ) ; } browseCursor = null ; } if ( expiryAlarmHandle != null ) { expiryAlarmHandle . cancel ( ) ; expiryAlarmHandle = null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "close" ) ; } | Close this session |
25,041 | public synchronized final void keepAlive ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "keepAlive" ) ; if ( ! closed ) { if ( expiryAlarmHandle != null ) { expiryAlarmHandle . cancel ( ) ; } expiryAlarmHandle = am . create ( parent . getMessageProcessor ( ) . getCustomProperties ( ) . get_browse_expiry_timeout ( ) , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "keepAlive" ) ; } | Keep this session alive |
25,042 | public void alarm ( Object thandle ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "alarm" , thandle ) ; synchronized ( this ) { if ( expiryAlarmHandle != null ) { expiryAlarmHandle = null ; close ( ) ; parent . removeBrowserSession ( key ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "alarm" ) ; } | The alarm has expired |
25,043 | public void setAsynchConsumerCallback ( int requestNumber , int maxActiveMessages , long messageLockExpiry , int batchsize , OrderingContext orderContext , boolean stoppable , int maxSequentialFailures , long hiddenMessageDelay ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setAsynchConsumerCallback" , new Object [ ] { requestNumber , maxActiveMessages , messageLockExpiry , batchsize , orderContext , stoppable , maxSequentialFailures , hiddenMessageDelay } ) ; try { if ( batchsize > 1 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "*** The batch size submitted to CATProxyConsumer was great than 1" ) ; } } getConsumerSession ( ) . registerAsynchConsumerCallback ( callback , maxActiveMessages , messageLockExpiry , batchsize , null ) ; } catch ( Exception e ) { RuntimeException r = new RuntimeException ( e . getMessage ( ) , e ) ; throw r ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setAsynchConsumerCallback" ) ; } | Sets the async consumer for a read ahead session . |
25,044 | public void deleteSet ( int requestNumber , SIMessageHandle [ ] msgHandles , int tran , boolean reply ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deleteSet" , new Object [ ] { requestNumber , msgHandles , tran , reply } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "Request to delete " + msgHandles . length + " message(s)" ) ; if ( reply ) SibTr . debug ( this , tc , "Client is expecting a reply" ) ; } try { SITransaction siTran = ( ( ServerLinkLevelState ) getConversation ( ) . getLinkLevelAttachment ( ) ) . getTransactionTable ( ) . get ( tran ) ; if ( siTran != IdToTransactionTable . INVALID_TRANSACTION ) { getConsumerSession ( ) . deleteSet ( msgHandles , siTran ) ; } try { if ( reply ) { getConversation ( ) . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_DELETE_SET_R , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".deleteSet" , CommsConstants . CATPROXYCONSUMER_DELETESET_02 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2014" , e ) ; } } catch ( SIException e ) { if ( ! ( ( ConversationState ) getConversation ( ) . getAttachment ( ) ) . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".deleteSet" , CommsConstants . CATPROXYCONSUMER_DELETESET_01 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; if ( reply ) { StaticCATHelper . sendExceptionToClient ( e , CommsConstants . CATPROXYCONSUMER_DELETESET_01 , getConversation ( ) , requestNumber ) ; } else { SibTr . error ( tc , "UNABLE_TO_DELETE_MSGS_SICO2007" , e ) ; StaticCATHelper . sendAsyncExceptionToClient ( e , CommsConstants . CATPROXYCONSUMER_DELETESET_01 , getClientSessionId ( ) , getConversation ( ) , 0 ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "deleteSet" ) ; } | This method will inform the ME that we have consumed messages that are currently locked on our behalf . |
25,045 | int sendMessage ( SIBusMessage sibMessage ) throws MessageCopyFailedException , IncorrectMessageTypeException , MessageEncodeFailedException , UnsupportedEncodingException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendMessage" , sibMessage ) ; int msgLen = 0 ; final HandshakeProperties props = getConversation ( ) . getHandshakeProperties ( ) ; if ( props . getFapLevel ( ) >= JFapChannelConstants . FAP_VERSION_9 ) { msgLen = sendChunkedMessage ( sibMessage ) ; } else { msgLen = sendEntireMessage ( sibMessage , null ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendMessage" , msgLen ) ; return msgLen ; } | This method will send a message to the attached client . |
25,046 | private int sendEntireMessage ( SIBusMessage sibMessage , List < DataSlice > messageSlices ) throws MessageCopyFailedException , IncorrectMessageTypeException , MessageEncodeFailedException , UnsupportedEncodingException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendEntireMessage" , new Object [ ] { sibMessage , messageSlices } ) ; int msgLen = 0 ; try { CommsServerByteBuffer buffer = poolManager . allocate ( ) ; ConversationState convState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; buffer . putShort ( convState . getConnectionObjectId ( ) ) ; buffer . putShort ( mainConsumer . getClientSessionId ( ) ) ; buffer . putShort ( mainConsumer . getMessageBatchNumber ( ) ) ; if ( messageSlices == null ) { msgLen = buffer . putMessage ( ( JsMessage ) sibMessage , convState . getCommsConnection ( ) , getConversation ( ) ) ; } else { msgLen = buffer . putMessgeWithoutEncode ( messageSlices ) ; } short jfapPriority = JFapChannelConstants . getJFAPPriority ( sibMessage . getPriority ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Sending with JFAP priority of " + jfapPriority ) ; getConversation ( ) . send ( buffer , JFapChannelConstants . SEG_PROXY_MESSAGE , 0 , jfapPriority , false , ThrottlingPolicy . BLOCK_THREAD , INVALIDATE_CONNECTION_ON_ERROR ) ; messagesSent ++ ; } catch ( SIException e1 ) { FFDCFilter . processException ( e1 , CLASS_NAME + ".sendEntireMessage" , CommsConstants . CATPROXYCONSUMER_SEND_MSG_01 , this ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2014" , e1 ) ; msgLen = 0 ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendEntireMessage" , msgLen ) ; return msgLen ; } | Send the entire message in one big buffer . If the messageSlices parameter is not null then the message has already been encoded and does not need to be done again . This may be in the case where the message was destined to be sent in chunks but is so small that it does not seem worth it . |
25,047 | public void setRequestedBytes ( int newRequestedBytes ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setRequestedBytes" , newRequestedBytes ) ; requestedBytes = newRequestedBytes ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setRequestedBytes" ) ; } | This method can be used to set the amount of bytes that the client has requested to keep in the proxy queue . |
25,048 | public void setSentBytes ( int newSentBytes ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setSentBytes" , newSentBytes ) ; sentBytes = newSentBytes ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setSentBytes" ) ; } | This method will update the amount of bytes we have sent to the client . |
25,049 | public void setLowestPriority ( short pri ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setLowestPriority" , pri ) ; mainConsumer . setLowestPriority ( pri ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setLowestPriority" ) ; } | This method will update the session lowest priority value . |
25,050 | private void setExtendedProperty ( String property , Object value ) { String dataType = extendedPropertiesDataType . get ( property ) ; String valueClass = value . getClass ( ) . getSimpleName ( ) ; if ( dataType . equals ( valueClass ) && ! extendedMultiValuedProperties . contains ( property ) ) { extendedPropertiesValue . put ( property , value ) ; } else if ( dataType . equals ( valueClass ) && extendedMultiValuedProperties . contains ( property ) ) { if ( value instanceof List ) { extendedPropertiesValue . put ( property , value ) ; } else { List < Object > values = ( List < Object > ) extendedPropertiesValue . get ( property ) ; if ( values == null ) { values = new ArrayList < Object > ( ) ; extendedPropertiesValue . put ( property , values ) ; } values . add ( value ) ; } } else { String type = value == null ? "null" : value . getClass ( ) . getName ( ) ; String msg = "Could not set extended property for Group property '" + property + "'. " + type + " is incompatible with " + dataType ; throw new ClassCastException ( msg ) ; } } | Set an extended property s value . |
25,051 | void balance ( int t0_depth , DeleteStack stack ) { int ntop = stack . topIndex ( ) ; InsertStack istack = stack . insertStack ( ) ; DeleteStack . Linearizer lxx = stack . linearizer ( ) ; DeleteStack . FringeNote xx = stack . fringeNote ( ) ; xx . depthDecrease = false ; xx . conditionalDecrease = false ; GBSNode f = stack . node ( ntop ) ; if ( ntop == 0 ) { f . setRightChild ( linearize ( lxx , f . rightChild ( ) ) ) ; return ; } GBSNode g = stack . node ( ntop - 1 ) ; boolean gLeft = true ; if ( g . rightChild ( ) == f ) { gLeft = false ; } if ( f . leftChild ( ) == stack . node ( ntop + 1 ) ) { leftFringe ( lxx , xx , istack , f , g , gLeft , t0_depth ) ; } else { rightFringe ( lxx , xx , istack , f , g , gLeft ) ; } lastFringe ( xx , g , gLeft , stack , ntop , istack ) ; } | Balance a fringe following delete . |
25,052 | private void leftFringe ( DeleteStack . Linearizer lxx , DeleteStack . FringeNote xx , InsertStack istack , GBSNode f , GBSNode g , boolean gLeft , int t0_depth ) { GBSNode w = f . rightChild ( ) ; GBSNode s = f . leftChild ( ) ; GBSNode bfather = g ; GBSNode sh = null ; GBSNode p = null ; int fbalance = f . balance ( ) ; f . clearBalance ( ) ; if ( w == null ) { sh = linearize ( lxx , s ) ; f . setRightChild ( null ) ; combine ( lastInList ( sh ) , f ) ; p = sh ; xx . depthDecrease = true ; } else { p = linearize ( lxx , s ) ; f . setChildren ( null , null ) ; combine ( lastInList ( p ) , f ) ; sh = p ; GBSNode wh = w . leftMostChild ( istack ) ; int zpoints = istack . index ( ) ; if ( zpoints > 0 ) { zpoints -- ; int ztop = 0 ; if ( zpoints >= t0_depth ) { ztop = zpoints - t0_depth + 1 ; sh = w ; bfather = istack . node ( ztop - 1 ) ; bfather . setLeftChild ( p ) ; } wh = linearize ( lxx , istack . node ( ztop ) ) ; } combine ( lastInList ( p ) , wh ) ; leftDepth ( xx , fbalance ) ; } if ( gLeft ) { g . setLeftChild ( sh ) ; } else { g . setRightChild ( sh ) ; } boolean bLeft = true ; if ( bfather . rightChild ( ) == p ) { bLeft = false ; } int maxBal = g . kFactor ( ) - 1 ; if ( maxBal < 3 ) { maxBal = 3 ; } istack . start ( bfather , "GBSDeleteFringe.leftFringe" ) ; istack . setNode ( 1 , null ) ; istack . resetBalancePointIndex ( ) ; int fpidx = 1 ; if ( g . kFactor ( ) > 2 ) { GBSInsertFringe . singleInstance ( ) . balance ( g . kFactor ( ) , istack , p , fpidx , maxBal ) ; } xx . newg = bfather ; if ( bLeft ) { xx . newf = bfather . leftChild ( ) ; } else { xx . newf = bfather . rightChild ( ) ; } } | Handle the case where we deleted from a left fringe . |
25,053 | private void rightFringe ( DeleteStack . Linearizer lxx , DeleteStack . FringeNote xx , InsertStack istack , GBSNode f , GBSNode g , boolean gLeft ) { GBSNode w = f . leftChild ( ) ; GBSNode s = f . rightChild ( ) ; int fbalance = f . balance ( ) ; f . clearBalance ( ) ; if ( w == null ) { boolean bLeft = true ; if ( g . rightChild ( ) == f ) { bLeft = false ; } f . setRightChild ( linearize ( lxx , s ) ) ; int maxBal = f . kFactor ( ) - 1 ; if ( maxBal < 3 ) { maxBal = 3 ; } istack . start ( g , "GBSDeleteFringe.rightFringe" ) ; istack . setNode ( 1 , null ) ; istack . resetBalancePointIndex ( ) ; int fpidx = 1 ; GBSInsertFringe . singleInstance ( ) . balance ( g . kFactor ( ) , istack , f , fpidx , maxBal ) ; xx . newg = g ; if ( bLeft ) { xx . newf = g . leftChild ( ) ; } else { xx . newf = g . rightChild ( ) ; } xx . depthDecrease = true ; } else { xx . newg = g ; if ( g . leftChild ( ) == f ) { g . setLeftChild ( w ) ; } else { g . setRightChild ( w ) ; } f . setLeftChild ( null ) ; GBSNode p = w . rightMostChild ( ) ; f . setRightChild ( linearize ( lxx , s ) ) ; combine ( p , f ) ; xx . newf = w ; rightDepth ( xx , fbalance ) ; } } | Handle the case where we deleted from a right fringe . |
25,054 | private void rightDepth ( DeleteStack . FringeNote xx , int fbalance ) { switch ( fbalance ) { case 1 : xx . depthDecrease = true ; break ; case 0 : xx . conditionalDecrease = true ; xx . conditionalBalance = 0 ; break ; case - 1 : xx . conditionalDecrease = true ; xx . conditionalBalance = 1 ; break ; default : throw new RuntimeException ( "Help! fbalance = " + fbalance ) ; } } | Given the original balance factor from the original parent of the t0 sub - tree from which we deleted from the right side determine the possible new balance factor and depth decrease indicator . |
25,055 | private void lastFringe ( DeleteStack . FringeNote xx , GBSNode g , boolean gLeft , DeleteStack stack , int ntop , InsertStack istack ) { if ( gLeft ) { stack . setNode ( ntop , g . leftChild ( ) ) ; } else { stack . setNode ( ntop , g . rightChild ( ) ) ; } GBSNode p = xx . newf ; GBSNode q = null ; istack . start ( xx . newg , "GBSDeleteFringe.lastFringe" ) ; istack . resetBalancePointIndex ( ) ; GBSNode fpoint = null ; int fdepth = 0 ; int fpidx = 0 ; while ( p != null ) { fdepth ++ ; istack . push ( p ) ; if ( fpoint == null ) { if ( p . leftChild ( ) == null ) { fdepth = 1 ; fpoint = p ; fpidx = istack . index ( ) ; } } q = p ; p = p . rightChild ( ) ; } int maxBal = g . kFactor ( ) + 1 ; if ( ( g . kFactor ( ) % 3 ) == 0 ) { maxBal = g . kFactor ( ) + 2 ; } if ( ( fdepth > maxBal ) || ( ( fdepth >= maxBal ) && ( q . isFull ( ) ) ) ) { GBSInsertFringe . singleInstance ( ) . balance ( g . kFactor ( ) , istack , fpoint , fpidx , maxBal ) ; if ( xx . conditionalDecrease ) { stack . node ( ntop ) . setBalance ( xx . conditionalBalance ) ; } xx . conditionalDecrease = false ; } if ( xx . conditionalDecrease ) { xx . depthDecrease = true ; } if ( xx . depthDecrease ) { GBSDeleteHeight . singleInstance ( ) . balance ( stack , ntop ) ; } } | Examine the final fringe and re - balance if necessary . |
25,056 | private GBSNode lastInList ( GBSNode p ) { GBSNode q = p ; p = p . rightChild ( ) ; while ( p != null ) { q = p ; p = p . rightChild ( ) ; } return q ; } | Return the last node in a linear list of nodes linked together by their right child pointer . |
25,057 | private GBSNode linearize ( DeleteStack . Linearizer xx , GBSNode p ) { xx . headp = null ; xx . lastp = null ; innerLinearize ( xx , p ) ; return xx . headp ; } | Turn a sub - fringe into a linear list . |
25,058 | private void innerLinearize ( DeleteStack . Linearizer xx , GBSNode p ) { xx . depth ++ ; if ( xx . depth > GBSTree . maxDepth ) throw new OptimisticDepthException ( "maxDepth (" + GBSTree . maxDepth + ") exceeded in GBSDeleteFringe.innerLinearize()." ) ; if ( p . leftChild ( ) != null ) { innerLinearize ( xx , p . leftChild ( ) ) ; } if ( xx . lastp == null ) { xx . headp = p ; } else { xx . lastp . setChildren ( null , p ) ; } xx . lastp = p ; if ( p . rightChild ( ) != null ) { innerLinearize ( xx , p . rightChild ( ) ) ; } xx . depth -- ; } | This is the recursive part of linearize . |
25,059 | public void init ( HttpInboundServiceContext sc , BNFHeaders hdrs ) { setOwner ( sc ) ; setBinaryParseState ( HttpInternalConstants . PARSING_BINARY_VERSION ) ; if ( null != hdrs ) { hdrs . duplicate ( this ) ; } initVersion ( ) ; } | Initialize this outgoing response message with specific headers ie . ones stored in a cache perhaps . |
25,060 | public void init ( HttpOutboundServiceContext sc , BNFHeaders hdrs ) { setOwner ( sc ) ; setBinaryParseState ( HttpInternalConstants . PARSING_BINARY_VERSION ) ; if ( null != hdrs ) { hdrs . duplicate ( this ) ; } } | Initialize this incoming response message with specific headers ie . ones stored in a cache perhaps . |
25,061 | private void initVersion ( ) { VersionValues ver = getServiceContext ( ) . getRequestVersion ( ) ; VersionValues configVer = getServiceContext ( ) . getHttpConfig ( ) . getOutgoingVersion ( ) ; if ( VersionValues . V10 . equals ( configVer ) && VersionValues . V11 . equals ( ver ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Configuration forcing 1.0 instead of 1.1" ) ; } setVersion ( configVer ) ; } else { setVersion ( ver ) ; } } | Initialize the response version to either match the request version or to the lower 1 . 0 version based on the channel configuration . |
25,062 | public boolean isBodyExpected ( ) { if ( VersionValues . V10 . equals ( getVersionValue ( ) ) ) { return isBodyAllowed ( ) ; } if ( getServiceContext ( ) . getRequestMethod ( ) . equals ( MethodValues . HEAD ) ) { return false ; } boolean rc = super . isBodyExpected ( ) ; if ( ! rc ) { rc = containsHeader ( HttpHeaderKeys . HDR_CONTENT_ENCODING ) || containsHeader ( HttpHeaderKeys . HDR_CONTENT_RANGE ) ; } if ( rc ) { rc = this . myStatusCode . isBodyAllowed ( ) ; } return rc ; } | Query whether a body is expected to be present with this message . Note that this is only an expectation and not a definitive answer . This will check the necessary headers status codes etc to see if any indicate a body should be present . Without actually reading for a body this cannot be sure however . |
25,063 | public boolean isBodyAllowed ( ) { if ( super . isBodyAllowed ( ) ) { if ( getServiceContext ( ) . getRequestMethod ( ) . equals ( MethodValues . HEAD ) ) { return false ; } return this . myStatusCode . isBodyAllowed ( ) ; } return false ; } | Query whether or not a body is allowed to be present for this message . This is not whether a body is present but rather only whether it is allowed to be present . |
25,064 | public void clear ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Clearing this response: " + this ) ; } super . clear ( ) ; this . myStatusCode = StatusCodes . OK ; this . myReason = null ; this . myReasonBytes = null ; } | Clear this message for re - use . |
25,065 | public void destroy ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Destroying this response: " + this ) ; } HttpObjectFactory tempFactory = getObjectFactory ( ) ; super . destroy ( ) ; if ( null != tempFactory ) { tempFactory . releaseResponse ( this ) ; } } | Destroy this response and return it to the factory . |
25,066 | public boolean parseBinaryFirstLine ( WsByteBuffer buff ) throws MalformedMessageException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "parseBinaryFirstLine for " + this ) ; Tr . debug ( tc , "Buffer: " + buff ) ; } if ( getBinaryParseState ( ) == HttpInternalConstants . PARSING_BINARY_VERSION ) { if ( ! buff . hasRemaining ( ) ) { return false ; } byte version = buff . get ( ) ; if ( version != HttpInternalConstants . BINARY_TRANSPORT_V1 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unsupported binary version in message: " + version ) ; } throw new MalformedMessageException ( "Invalid binary message" ) ; } setBinaryParseState ( HttpInternalConstants . PARSING_VERSION_ID_OR_LEN ) ; resetCacheToken ( 4 ) ; } boolean lineEnds = false ; int value ; while ( ! lineEnds ) { if ( ! fillCacheToken ( buff ) ) { return false ; } switch ( getBinaryParseState ( ) ) { case HttpInternalConstants . PARSING_VERSION_ID_OR_LEN : value = GenericUtils . asInt ( getParsedToken ( ) ) ; if ( 0 == ( value & GenericConstants . KNOWN_MASK ) ) { setVersion ( VersionValues . getByOrdinal ( value ) ) ; setBinaryParseState ( HttpInternalConstants . PARSING_STATUS ) ; resetCacheToken ( 4 ) ; } else { setBinaryParseState ( HttpInternalConstants . PARSING_UNKNOWN_VERSION ) ; resetCacheToken ( value & GenericConstants . UNKNOWN_MASK ) ; } break ; case HttpInternalConstants . PARSING_UNKNOWN_VERSION : setVersion ( VersionValues . find ( getParsedToken ( ) ) ) ; setBinaryParseState ( HttpInternalConstants . PARSING_STATUS ) ; createCacheToken ( 4 ) ; break ; case HttpInternalConstants . PARSING_STATUS : setStatusCode ( GenericUtils . asInt ( getParsedToken ( ) ) ) ; setBinaryParseState ( HttpInternalConstants . PARSING_REASON_LEN ) ; resetCacheToken ( 4 ) ; break ; case HttpInternalConstants . PARSING_REASON_LEN : value = GenericUtils . asInt ( getParsedToken ( ) ) ; if ( 0 == value ) { setBinaryParseState ( GenericConstants . PARSING_HDR_FLAG ) ; resetCacheToken ( 4 ) ; lineEnds = true ; } else { setBinaryParseState ( HttpInternalConstants . PARSING_REASON ) ; resetCacheToken ( value ) ; } break ; case HttpInternalConstants . PARSING_REASON : setReasonPhrase ( getParsedToken ( ) ) ; setBinaryParseState ( GenericConstants . PARSING_HDR_FLAG ) ; createCacheToken ( 4 ) ; lineEnds = true ; break ; default : throw new MalformedMessageException ( "Invalid state in line: " + getBinaryParseState ( ) ) ; } } setFirstLineComplete ( true ) ; return true ; } | Begin parsing line out from a given buffer . Returns boolean as to whether it has found the end of the first line . |
25,067 | public WsByteBuffer [ ] marshallBinaryFirstLine ( ) { WsByteBuffer [ ] firstLine = new WsByteBuffer [ 1 ] ; firstLine [ 0 ] = allocateBuffer ( getOutgoingBufferSize ( ) ) ; firstLine = putByte ( HttpInternalConstants . BINARY_TRANSPORT_V1 , firstLine ) ; if ( getVersionValue ( ) . isUndefined ( ) ) { byte [ ] data = getVersionValue ( ) . getByteArray ( ) ; firstLine = putInt ( data . length | GenericConstants . KNOWN_MASK , firstLine ) ; firstLine = putBytes ( data , firstLine ) ; } else { firstLine = putInt ( getVersionValue ( ) . getOrdinal ( ) , firstLine ) ; } firstLine = putInt ( this . myStatusCode . getIntCode ( ) , firstLine ) ; if ( null != this . myReasonBytes ) { firstLine = putInt ( this . myReasonBytes . length , firstLine ) ; firstLine = putBytes ( this . myReasonBytes , firstLine ) ; } else { firstLine = putInt ( 0 , firstLine ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Marshalling binary first line: " + getVersion ( ) + " " + getStatusCodeAsInt ( ) + " " + getReasonPhrase ( ) ) ; } return firstLine ; } | Called for marshalling the first line of binary HTTP responses . |
25,068 | protected void parsingComplete ( ) throws MalformedMessageException { int num = getNumberFirstLineTokens ( ) ; if ( 3 != num && 2 != num ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "numFirstLineTokensRead is " + getNumberFirstLineTokens ( ) ) ; } if ( getServiceContext ( ) . getHttpConfig ( ) . getDebugLog ( ) . isEnabled ( DebugLog . Level . WARN ) ) { getServiceContext ( ) . getHttpConfig ( ) . getDebugLog ( ) . log ( DebugLog . Level . WARN , HttpMessages . MSG_PARSE_INVALID_FIRSTLINE , getServiceContext ( ) ) ; } throw new MalformedMessageException ( "Received " + getNumberFirstLineTokens ( ) + " first line tokens" ) ; } } | Called the parsing of the first line is complete . Performs checks on whether all the necessary data has been found . |
25,069 | public void setStatusCode ( StatusCodes code ) { if ( ! code . equals ( this . myStatusCode ) ) { this . myStatusCode = code ; this . myReason = null ; this . myReasonBytes = null ; super . setFirstLineChanged ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "setStatusCode(sc): " + code ) ; } } | Set the status code of the response message . |
25,070 | public boolean isTemporaryStatusCode ( ) { int code = this . myStatusCode . getIntCode ( ) ; if ( HttpDispatcher . useEE7Streams ( ) && ( code == 101 ) ) return false ; return ( 100 <= code && 200 > code ) ; } | Query whether this response message s status code represents a temporary status of 1xx . |
25,071 | public String getReasonPhrase ( ) { if ( null == this . myReason ) { this . myReason = GenericUtils . getEnglishString ( getReasonPhraseBytes ( ) ) ; } return this . myReason ; } | Query the value of the reason phrase . |
25,072 | public void debug ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Response Message: " + this ) ; Tr . debug ( tc , "Status: " + getStatusCodeAsInt ( ) ) ; Tr . debug ( tc , "Reason: " + getReasonPhrase ( ) ) ; super . debug ( ) ; } } | Debug print this response message to the RAS trace log . |
25,073 | public AS_ContextSec encodeIOR ( Codec codec ) throws Exception { AS_ContextSec result = new AS_ContextSec ( ) ; result . target_supports = 0 ; result . target_requires = 0 ; result . client_authentication_mech = Util . encodeOID ( NULL_OID ) ; result . target_name = Util . encodeGSSExportName ( NULL_OID , "" ) ; return result ; } | This method should not be invoked but just in case that is not the case return null OID . |
25,074 | @ SuppressWarnings ( "unchecked" ) private < T > Entry < Collection < ? extends Callable < T > > , TaskLifeCycleCallback [ ] > createCallbacks ( Collection < ? extends Callable < T > > tasks ) { int numTasks = tasks . size ( ) ; TaskLifeCycleCallback [ ] callbacks = new TaskLifeCycleCallback [ numTasks ] ; List < Callable < T > > taskUpdates = null ; if ( numTasks == 1 ) { Callable < T > task = tasks . iterator ( ) . next ( ) ; ThreadContextDescriptor contextDescriptor ; if ( task instanceof ContextualAction ) { ContextualAction < Callable < T > > a = ( ContextualAction < Callable < T > > ) task ; contextDescriptor = a . getContextDescriptor ( ) ; task = a . getAction ( ) ; taskUpdates = Arrays . asList ( task ) ; } else { contextDescriptor = getContextService ( ) . captureThreadContext ( getExecutionProperties ( task ) ) ; } callbacks [ 0 ] = new TaskLifeCycleCallback ( this , contextDescriptor ) ; } else { Map < Map < String , String > , TaskLifeCycleCallback > execPropsToCallback = new HashMap < Map < String , String > , TaskLifeCycleCallback > ( ) ; WSContextService contextSvc = null ; int t = 0 ; for ( Callable < T > task : tasks ) { if ( task instanceof ContextualAction ) { ContextualAction < Callable < T > > a = ( ContextualAction < Callable < T > > ) task ; taskUpdates = taskUpdates == null ? new ArrayList < Callable < T > > ( tasks ) : taskUpdates ; taskUpdates . set ( t , a . getAction ( ) ) ; callbacks [ t ++ ] = new TaskLifeCycleCallback ( this , a . getContextDescriptor ( ) ) ; } else { Map < String , String > execProps = getExecutionProperties ( task ) ; TaskLifeCycleCallback callback = execPropsToCallback . get ( execProps ) ; if ( callback == null ) { contextSvc = contextSvc == null ? getContextService ( ) : contextSvc ; execPropsToCallback . put ( execProps , callback = new TaskLifeCycleCallback ( this , contextSvc . captureThreadContext ( execProps ) ) ) ; } callbacks [ t ++ ] = callback ; } } } return new SimpleEntry < Collection < ? extends Callable < T > > , TaskLifeCycleCallback [ ] > ( taskUpdates == null ? tasks : taskUpdates , callbacks ) ; } | Capture context for a list of tasks and create callbacks that apply context and notify the ManagedTaskListener if any . Context is not re - captured for any tasks that implement the ContextualAction marker interface . |
25,075 | final Map < String , String > getExecutionProperties ( Object task ) { if ( task == null ) throw new NullPointerException ( Tr . formatMessage ( tc , "CWWKC1111.task.invalid" , ( Object ) null ) ) ; Map < String , String > execProps = task instanceof ManagedTask ? ( ( ManagedTask ) task ) . getExecutionProperties ( ) : null ; if ( execProps == null ) execProps = defaultExecutionProperties . get ( ) ; else { execProps = new TreeMap < String , String > ( execProps ) ; String tranProp = execProps . remove ( ManagedTask . TRANSACTION ) ; if ( tranProp != null && ! ManagedTask . SUSPEND . equals ( tranProp ) ) throw new RejectedExecutionException ( Tr . formatMessage ( tc , "CWWKC1130.xprop.value.invalid" , name , ManagedTask . TRANSACTION , tranProp ) ) ; if ( ! execProps . containsKey ( WSContextService . DEFAULT_CONTEXT ) ) execProps . put ( WSContextService . DEFAULT_CONTEXT , WSContextService . UNCONFIGURED_CONTEXT_TYPES ) ; if ( ! execProps . containsKey ( WSContextService . TASK_OWNER ) ) execProps . put ( WSContextService . TASK_OWNER , name . get ( ) ) ; } return execProps ; } | Returns execution properties for the task . |
25,076 | final String getIdentifier ( String policyExecutorIdentifier ) { return policyExecutorIdentifier . startsWith ( "managed" ) ? policyExecutorIdentifier : new StringBuilder ( name . get ( ) ) . append ( " (" ) . append ( policyExecutorIdentifier ) . append ( ')' ) . toString ( ) ; } | Utility method to compute the identifier to be used in combination with the specified policy executor identifier . We prepend the managed executor name if it isn t already included in the policy executor s identifier . |
25,077 | @ Reference ( policy = ReferencePolicy . DYNAMIC , target = "(id=unbound)" ) protected void setConcurrencyPolicy ( ConcurrencyPolicy svc ) { policyExecutor = svc . getExecutor ( ) ; } | Declarative Services method for setting the concurrency policy . |
25,078 | @ Reference ( policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . OPTIONAL , target = "(id=unbound)" ) protected void setLongRunningPolicy ( ConcurrencyPolicy svc ) { longRunningPolicyExecutorRef . set ( svc . getExecutor ( ) ) ; } | Declarative Services method for setting the long running concurrency policy . |
25,079 | ThreadContext suspendTransaction ( ) { ThreadContextProvider tranContextProvider = AccessController . doPrivileged ( tranContextProviderAccessor ) ; ThreadContext suspendedTranSnapshot = tranContextProvider == null ? null : tranContextProvider . captureThreadContext ( XPROPS_SUSPEND_TRAN , null ) ; if ( suspendedTranSnapshot != null ) suspendedTranSnapshot . taskStarting ( ) ; return suspendedTranSnapshot ; } | Uses the transaction context provider to suspends the currently active transaction or LTC on the thread . |
25,080 | final void stop ( ) { final String methodName = "stop" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } try { if ( ( _session != null ) && ( ! _sessionStopped ) ) { sessionStarted = false ; stopIfRequired ( ) ; } } catch ( final SIException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , "1:878:1.68" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } } catch ( final SIErrorException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , "1:886:1.68" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } } | Stop this listener . Stops the consumer session . |
25,081 | public synchronized void consumeMessages ( final LockedMessageEnumeration lockedMessages ) { final String methodName = "consumeMessages" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , lockedMessages ) ; } if ( sessionStarting ) { if ( TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "Return this method, as startSession() is in progress." ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } return ; } synchronized ( insideConsumeMessagesLock ) { insideConsumeMessages = true ; } MessagePacingControl mpc = MessagePacingControlFactory . getInstance ( ) ; if ( mpc != null && mpc . isActive ( ) ) { AsynchResumeCallbackImpl asyncResumeCallback = new AsynchResumeCallbackImpl ( ) ; AsynchDispatchScheduler aysnDispatchScheduler = mpc . preAsynchDispatch ( _connection . getEndpointConfiguration ( ) . getBusName ( ) , _destinationAddress . getDestinationName ( ) , asyncResumeCallback ) ; if ( aysnDispatchScheduler . suspendAsynchDispatcher ( ) ) { mpcPacingSessionStarted = false ; asyncResumeCallback . createCachedEnumeration ( lockedMessages , aysnDispatchScheduler ) ; } else { internalConsumeMessages ( lockedMessages , aysnDispatchScheduler ) ; } } else { internalConsumeMessages ( lockedMessages , null ) ; } synchronized ( insideConsumeMessagesLock ) { insideConsumeMessages = false ; try { stopIfRequired ( ) ; } catch ( final SIException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , "1:979:1.68" , this ) ; if ( TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } } catch ( final SIErrorException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , "1:986:1.68" , this ) ; if ( TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } } | Invoked by the message processor with an enumeration containing one or more messages locked to this consumer . Retrieves the messages from the enumeration . Schedules a piece of work that will create the dispatcher on a new thread . |
25,082 | static SIMessageHandle [ ] getMessageHandles ( final List messages ) { final SIMessageHandle [ ] messageHandles = new SIMessageHandle [ messages . size ( ) ] ; for ( int i = 0 ; i < messageHandles . length ; i ++ ) { final SIBusMessage message = ( SIBusMessage ) messages . get ( i ) ; messageHandles [ i ] = message . getMessageHandle ( ) ; } return messageHandles ; } | Converts a list of messages to an array of message handles . |
25,083 | protected void startSession ( boolean deliverImmediately ) throws SIException { final String methodName = "startSession" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { this , new Boolean ( deliverImmediately ) } ) ; } boolean sessionStartingByThisThread = false ; synchronized ( sessionStartingLock ) { if ( ! sessionStarting ) { if ( sibPacingSessionStarted && mpcPacingSessionStarted && sessionStarted ) { sessionStarting = true ; sessionStartingByThisThread = true ; } } if ( TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , methodName , "sibPacingSessionStarted: " + sibPacingSessionStarted + "\nmpcPacingSessionStarted: " + mpcPacingSessionStarted + "\ncallbackWaiting: " + callbackWaiting + "\nsessionStarted: " + sessionStarted + "\nsessionStartingByThisThread: " + sessionStartingByThisThread ) ; } } if ( sessionStartingByThisThread ) { boolean startRequired = false ; synchronized ( asyncResumeCallbackWaitLock ) { if ( callbackWaiting ) { asyncResumeCallbackWaitLock . notifyAll ( ) ; callbackWaiting = false ; } else startRequired = true ; } if ( startRequired ) _session . start ( deliverImmediately ) ; sessionStarting = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } } | Request that the session starts . This will only occur if both SIB pacing AND MPC pacing agree that the session should start . |
25,084 | public String dump ( ) { StringBuilder sb = new StringBuilder ( ) ; String newLine = ContainerProperties . LineSeparator ; sb . append ( newLine ) . append ( "-- WCCMMetaData dump --" ) ; sb . append ( newLine ) . append ( "enterpriseBean = " ) . append ( enterpriseBean ) ; dump ( sb ) ; sb . append ( newLine ) . append ( ", ejbjar = " ) . append ( ejbjar ) ; sb . append ( newLine ) . append ( "-- WCCMMetaData end dump --" ) ; return sb . toString ( ) ; } | Dump contents of this object into a String object that is typically used for tracing . |
25,085 | public void updateChecksums ( ) { for ( Entry < File , ChecksumData > entry : checksumsMap . entrySet ( ) ) { updateChecksums ( entry . getKey ( ) , entry . getValue ( ) ) ; } } | Updates the checkSumsMap for all entries . |
25,086 | public void updateChecksums ( File featureDir , ChecksumData checksumData ) { Collection < File > csFiles = new ArrayList < File > ( ) ; File featureChecksumsDir = new File ( featureDir , "checksums" ) ; getCheckSumFiles ( featureChecksumsDir , csFiles ) ; File libFeaturesChecksumsDir = new File ( Utils . getInstallDir ( ) , "lib/features/checksums" ) ; if ( libFeaturesChecksumsDir . getAbsoluteFile ( ) . equals ( featureChecksumsDir . getAbsoluteFile ( ) ) ) { File libPlatformChecksumsDir = new File ( Utils . getInstallDir ( ) , "lib/platform/checksums" ) ; getCheckSumFiles ( libPlatformChecksumsDir , csFiles ) ; } Properties existingChecksums = initChecksumProps ( checksumData . existingChecksums ) ; for ( File csFile : csFiles ) { Properties csprops = loadChecksumFile ( csFile ) ; boolean modified = false ; for ( Entry < Object , Object > csEntry : csprops . entrySet ( ) ) { Object k = csEntry . getKey ( ) ; if ( checksumData . newChecksums . containsKey ( k ) ) { Object newChecksum = checksumData . newChecksums . get ( k ) ; if ( ! csEntry . getValue ( ) . equals ( newChecksum ) ) { csprops . put ( k , newChecksum ) ; modified = true ; } } if ( ! checksumData . isIgnoredCSFile ( csFile ) && existingChecksums . containsKey ( k ) ) { existingChecksums . put ( k , csEntry . getValue ( ) ) ; } } if ( modified ) { saveChecksumFile ( csFile , csprops , " for new checksum." ) ; } } for ( Entry < String , Set < String > > entry : checksumData . existingChecksums . entrySet ( ) ) { String f = entry . getKey ( ) ; File csFile = new File ( featureChecksumsDir , f + ".cs" ) ; if ( csFile . exists ( ) ) { Properties csprops = loadChecksumFile ( csFile ) ; boolean modified = false ; for ( String s : entry . getValue ( ) ) { if ( csprops . containsKey ( s ) && existingChecksums . containsKey ( s ) ) { String cs = ( String ) existingChecksums . get ( s ) ; if ( cs != null && ! cs . isEmpty ( ) ) { csprops . put ( s , cs ) ; modified = true ; } } } if ( modified ) { saveChecksumFile ( csFile , csprops , " for exising checksum." ) ; } } } } | Updates the check sum for a specific feature directory . |
25,087 | private Properties initChecksumProps ( Map < String , Set < String > > useOldChecksums ) { Properties checksumProps = new Properties ( ) ; for ( Set < String > set : useOldChecksums . values ( ) ) { for ( String s : set ) { checksumProps . put ( s , "" ) ; } } return checksumProps ; } | Populates a new property file with the inputed checksum map and empty strings . |
25,088 | public static Properties loadChecksumFile ( File csFile ) { InputStream csis = null ; Properties csprops = new Properties ( ) ; try { csis = new FileInputStream ( csFile ) ; csprops . load ( csis ) ; } catch ( IOException e ) { logger . log ( Level . FINEST , "Failed to load the checksum file: " + csFile . getAbsolutePath ( ) , e ) ; } finally { InstallUtils . close ( csis ) ; } return csprops ; } | Loads the checksum file into a properties object |
25,089 | public static void saveChecksumFile ( File csFile , Properties csprops , String reason ) { FileOutputStream fOut = null ; try { fOut = new FileOutputStream ( csFile ) ; csprops . store ( fOut , null ) ; logger . log ( Level . FINEST , "Successfully updated the checksum file " + csFile . getAbsolutePath ( ) + reason ) ; } catch ( Exception e ) { logger . log ( Level . FINEST , "Failed to save checksum file " + csFile . getAbsolutePath ( ) + reason , e ) ; } finally { InstallUtils . close ( fOut ) ; } } | Saves the checksum properties to csFile . |
25,090 | public void registerNewChecksums ( File featureDir , String fileName , String checksum ) { ChecksumData checksums = checksumsMap . get ( featureDir ) ; if ( checksums == null ) { checksums = new ChecksumData ( ) ; checksumsMap . put ( featureDir , checksums ) ; } checksums . registerNewChecksums ( fileName , checksum ) ; } | Registers a new feature directory s new checksum |
25,091 | public void registerExistingChecksums ( File featureDir , String symbolicName , String fileName ) { ChecksumData checksums = checksumsMap . get ( featureDir ) ; if ( checksums == null ) { checksums = new ChecksumData ( ) ; checksumsMap . put ( featureDir , checksums ) ; } checksums . registerExistingChecksums ( symbolicName , fileName ) ; } | Registers an existing feature directory s checksum |
25,092 | private TopLevelStepExecutionEntity getStepExecutionTopLevelFromJobExecutionIdAndStepName ( long jobExecutionId , String stepName ) { JobExecutionEntity jobExecution = data . executionInstanceData . get ( jobExecutionId ) ; for ( StepThreadExecutionEntity stepExec : new ArrayList < StepThreadExecutionEntity > ( jobExecution . getStepThreadExecutions ( ) ) ) { if ( stepExec . getStepName ( ) . equals ( stepName ) ) { if ( stepExec instanceof TopLevelStepExecutionEntity ) { return ( TopLevelStepExecutionEntity ) stepExec ; } } } throw new IllegalStateException ( "Couldn't find top-level step execution for jobExecution = " + jobExecutionId + ", and stepName = " + stepName ) ; } | Not well - suited to factor out into an interface method since for JPA it s embedded in a tran typically |
25,093 | public void deleteStepThreadInstanceOfRelatedPartitions ( TopLevelStepInstanceKey stepInstanceKey ) { long compareInstanceId = stepInstanceKey . getJobInstance ( ) ; for ( StepThreadInstanceEntity stepThreadInstance : data . stepThreadInstanceData . values ( ) ) { if ( ( stepThreadInstance . getJobInstance ( ) . getInstanceId ( ) == compareInstanceId ) && ( stepThreadInstance . getStepName ( ) . equals ( stepInstanceKey . getStepName ( ) ) ) && ( ! ( stepThreadInstance instanceof TopLevelStepInstanceEntity ) ) ) { StepThreadInstanceKey removalKey = new StepThreadInstanceKey ( stepThreadInstance ) ; data . stepThreadInstanceData . remove ( removalKey ) ; } } } | It might seems like this should delete related partition - level step executions as well . |
25,094 | public SIBusMessage next ( ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SIErrorException , SINotAuthorizedException { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "next" ) ; checkAlreadyClosed ( ) ; SIBusMessage message = null ; synchronized ( lock ) { try { closeLock . readLock ( ) . lockInterruptibly ( ) ; try { message = proxyQueue . next ( ) ; } catch ( MessageDecodeFailedException mde ) { FFDCFilter . processException ( mde , CLASS_NAME + ".next" , CommsConstants . BROWSERSESSION_NEXT_01 , this ) ; SIResourceException coreException = new SIResourceException ( mde ) ; throw coreException ; } finally { closeLock . readLock ( ) . unlock ( ) ; } } catch ( InterruptedException e ) { if ( tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "interrupted exception" ) ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "next" , message ) ; return message ; } | f169897 . 2 changed throws |
25,095 | public void close ( ) throws SIResourceException , SIConnectionLostException , SIErrorException , SIConnectionDroppedException { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" ) ; synchronized ( lock ) { if ( ! isClosed ( ) ) { try { closeLock . writeLock ( ) . lockInterruptibly ( ) ; try { proxyQueue . close ( ) ; setClosed ( ) ; } finally { closeLock . writeLock ( ) . unlock ( ) ; } } catch ( InterruptedException e ) { if ( tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "interrupted exception" ) ; } } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; } | Closes the browser session . This involves some synchronization flowing a close request and also marking the appropriate objects as closed . |
25,096 | public void reset ( ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SIErrorException { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reset" ) ; checkAlreadyClosed ( ) ; synchronized ( lock ) { try { closeLock . readLock ( ) . lockInterruptibly ( ) ; try { proxyQueue . reset ( ) ; } finally { closeLock . readLock ( ) . unlock ( ) ; } } catch ( InterruptedException e ) { if ( tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "interrupted exception" ) ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "reset" ) ; } | f169897 . 2 added |
25,097 | static InjectionBinding < WebServiceRef > createWebServiceRefBindingFromResource ( Resource resource , ComponentNameSpaceConfiguration cnsConfig , Class < ? > serviceClass , String jndiName ) throws InjectionException { InjectionBinding < WebServiceRef > binding = null ; WebServiceRef wsRef = createWebServiceRefFromResource ( resource , serviceClass , jndiName ) ; WebServiceRefInfo wsrInfo = WebServiceRefInfoBuilder . buildWebServiceRefInfo ( wsRef , cnsConfig . getClassLoader ( ) ) ; wsrInfo . setClientMetaData ( JaxWsMetaDataManager . getJaxWsClientMetaData ( cnsConfig . getModuleMetaData ( ) ) ) ; wsrInfo . setServiceInterfaceClassName ( serviceClass . getName ( ) ) ; binding = new WebServiceRefBinding ( wsRef , cnsConfig ) ; ( ( WebServiceRefBinding ) binding ) . setWebServiceRefInfo ( wsrInfo ) ; ( ( WebServiceRefBinding ) binding ) . setResourceType ( true ) ; return binding ; } | This method will be used to create an instance of a WebServiceRefBinding object that holds metadata obtained from an |
25,098 | static WebServiceRef createWebServiceRefFromResource ( Resource resource , Class < ? > typeClass , String jndiName ) throws InjectionException { return new WebServiceRefSimulator ( resource . mappedName ( ) , jndiName , typeClass , Service . class , null , "" ) ; } | This creates an |
25,099 | protected Object getTreeStructureToSave ( FacesContext facesContext ) { if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Entering getTreeStructureToSave" ) ; } UIViewRoot viewRoot = facesContext . getViewRoot ( ) ; if ( viewRoot . isTransient ( ) ) { return null ; } TreeStructureManager tsm = new TreeStructureManager ( ) ; Object retVal = tsm . buildTreeStructureToSave ( viewRoot ) ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Exiting getTreeStructureToSave" ) ; } return retVal ; } | Return an object which contains info about the UIComponent type of each node in the view tree . This allows an identical UIComponent tree to be recreated later though all the components will have just default values for their members . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.