idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
38,900 | public synchronized void releaseId ( short id ) throws IdAllocatorException { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "releaseId" , "" + id ) ; deallocate ( id ) ; if ( id == ( nextId - 1 ) ) { nextId = id ; if ( nextId == lastFreeId ) { lastFreeId = NULL_ID ; } } else { lastFreeId = id ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "releaseId" ) ; } | Releases an ID making it available to be allocated once more . |
38,901 | private String firstConstantOfEnum ( ) { Object [ ] enumConstants = targetClass . getEnumConstants ( ) ; if ( enumConstants . length != 0 ) { return enumConstants [ 0 ] . toString ( ) ; } return "" ; } | find the first constant value of the targetClass and return as a String |
38,902 | void checkTopicPublishPermission ( String topic ) { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm == null ) return ; sm . checkPermission ( new TopicPermission ( topic , PUBLISH ) ) ; } | Check if the caller has permission to publish events to the specified topic . |
38,903 | protected void activate ( ComponentContext componentContext , Map < String , Object > props ) { this . componentContext = componentContext ; bundleContext = componentContext . getBundleContext ( ) ; frameworkEventAdapter = new FrameworkEventAdapter ( this ) ; bundleContext . addFrameworkListener ( frameworkEventAdapter ) ; bundleEventAdapter = new BundleEventAdapter ( this ) ; bundleContext . addBundleListener ( bundleEventAdapter ) ; serviceEventAdapter = new ServiceEventAdapter ( this ) ; bundleContext . addServiceListener ( serviceEventAdapter ) ; processConfigProperties ( props ) ; } | Activate the EventEngine implementation . This method will be called by OSGi Declarative Services implementation when the component is initially activated and when changes to our configuration have occurred . |
38,904 | protected void deactivate ( ComponentContext componentContext ) { bundleContext . removeFrameworkListener ( frameworkEventAdapter ) ; frameworkEventAdapter = null ; bundleContext . removeBundleListener ( bundleEventAdapter ) ; bundleEventAdapter = null ; bundleContext . removeServiceListener ( serviceEventAdapter ) ; serviceEventAdapter = null ; bundleContext = null ; this . componentContext = null ; } | Deactivate the EventAdmin service . This method will be called by the OSGi Declarative Services implementation when the component is deactivated . Deactivation will occur when the service configuration needs to be refreshed when the bundle is stopped or when the DS implementation is stopped . |
38,905 | public void addTopic ( String topic ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addTopic" , topic ) ; SelectionCriteria criteria = _messageProcessor . getSelectionCriteriaFactory ( ) . createSelectionCriteria ( topic , null , SelectorDomain . SIMESSAGE ) ; if ( _subscriptionState == null ) { _subscriptionState = new ConsumerDispatcherState ( _destinationHandler . getUuid ( ) , criteria , _destName , _busName ) ; } else _subscriptionState . addSelectionCriteria ( criteria ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addTopic" ) ; } | Adds a topic to the subscription state for this OutputHandler . |
38,906 | public void removeTopic ( String topic ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeTopic" , topic ) ; if ( _subscriptionState == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "removeTopic" , "Topic not found" ) ; } else _subscriptionState . removeTopic ( topic ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeTopic" ) ; } | Removes a topic from the set of topics with this OutputHandler |
38,907 | public String [ ] getTopics ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getTopics" ) ; String [ ] topics = null ; if ( _subscriptionState != null ) topics = _subscriptionState . getTopics ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getTopics" , topics ) ; return topics ; } | Get the set of topics associated with this OutputHandler |
38,908 | public SIBUuid12 getTopicSpaceUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getTopicSpaceUuid" ) ; SIBUuid12 retval = _destinationHandler . getUuid ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getTopicSpaceUuid" , retval ) ; return retval ; } | Get the topic space name associated with this OutputHandler |
38,909 | void processAckExpected ( long ackExpStamp , int priority , Reliability reliability , SIBUuid12 stream ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processAckExpected" , new Long ( ackExpStamp ) ) ; _internalOutputStreamManager . processAckExpected ( ackExpStamp , priority , reliability , stream ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processAckExpected" ) ; } | needs to be forwarded downstream . |
38,910 | public void sendSilenceMessage ( long startStamp , long endStamp , long completedPrefix , boolean requestedOnly , int priority , Reliability reliability , SIBUuid12 stream ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendSilenceMessage" , new Object [ ] { new Long ( startStamp ) , new Long ( endStamp ) , new Long ( completedPrefix ) , new Integer ( priority ) , reliability } ) ; ControlSilence sMsg ; try { sMsg = _cmf . createNewControlSilence ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PubSubOutputHandler.sendSilenceMessage" , "1:787:1.164.1.5" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PubSubOutputHandler" , "1:794:1.164.1.5" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendSilenceMessage" , e ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PubSubOutputHandler" , "1:805:1.164.1.5" , e } , null ) , e ) ; } SIMPUtils . setGuaranteedDeliveryProperties ( sMsg , _messageProcessor . getMessagingEngineUuid ( ) , null , stream , null , _destinationHandler . getUuid ( ) , ProtocolType . PUBSUBINPUT , GDConfig . PROTOCOL_VERSION ) ; sMsg . setStartTick ( startStamp ) ; sMsg . setEndTick ( endStamp ) ; sMsg . setPriority ( priority ) ; sMsg . setReliability ( reliability ) ; sMsg . setCompletedPrefix ( completedPrefix ) ; sMsg . setRequestedOnly ( requestedOnly ) ; if ( _isLink ) { sMsg = ( ControlSilence ) addLinkProps ( sMsg ) ; } SIBUuid8 [ ] fromTo = new SIBUuid8 [ 1 ] ; fromTo [ 0 ] = _targetMEUuid ; if ( requestedOnly ) _mpio . sendDownTree ( fromTo , priority + 1 , sMsg ) ; else _mpio . sendDownTree ( fromTo , priority , sMsg ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendSilenceMessage" ) ; } | sendSilenceMessage may be called from InternalOutputStream when a Nack is recevied |
38,911 | public void sendLinkMessage ( MessageItem msgItem , boolean rollback ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendLinkMessage" , msgItem ) ; JsMessage jsMsg = null ; try { jsMsg = msgItem . getMessage ( ) . getReceived ( ) ; } catch ( MessageCopyFailedException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PubSubOutputHandler.sendLinkMessage" , "1:1097:1.164.1.5" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendLinkMessage" , "SIErrorException" ) ; throw new SIErrorException ( e ) ; } SIBUuid8 [ ] fromTo = new SIBUuid8 [ 1 ] ; fromTo [ 0 ] = _targetMEUuid ; if ( rollback ) { ControlMessage cMsg = createSilenceMessage ( jsMsg . getGuaranteedValueValueTick ( ) , jsMsg . getGuaranteedValueCompletedPrefix ( ) , msgItem . getPriority ( ) , msgItem . getReliability ( ) , jsMsg . getGuaranteedStreamUUID ( ) ) ; cMsg = addLinkProps ( cMsg ) ; cMsg . setRoutingDestination ( _routingDestination ) ; _mpio . sendDownTree ( fromTo , msgItem . getPriority ( ) , cMsg ) ; } else { jsMsg = addLinkProps ( jsMsg ) ; jsMsg . setRoutingDestination ( _routingDestination ) ; jsMsg . setGuaranteedSourceMessagingEngineUUID ( _messageProcessor . getMessagingEngineUuid ( ) ) ; _mpio . sendDownTree ( fromTo , msgItem . getPriority ( ) , jsMsg ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendLinkMessage" ) ; } | properties need to be set on the mssage |
38,912 | public void removeStream ( SIBUuid12 stream ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeStream" , stream ) ; _internalOutputStreamManager . remove ( stream ) ; deregisterControlAdapterMBean ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeStream" ) ; } | This method is called by the input handler when it flushes a local stream . This is our cue to remove any data structures we may be maintaining for this stream . |
38,913 | public void setTopicSpaceMapping ( String foreignTSName ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setTopicSpaceMapping" , foreignTSName ) ; _routingDestination = SIMPUtils . createJsDestinationAddress ( foreignTSName , null , _neighbour . getBusId ( ) ) ; this . _foreignTSName = foreignTSName ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setTopicSpaceMapping" ) ; } | Creates the JsDestinationAddress object passed over in publications to foreign buses . |
38,914 | public SynchronizationRegistryUOWScope getCurrentTransactionalUOW ( boolean checkMarkedRollback ) throws CSITransactionRolledbackException { UOWCoordinator coord = uowCurrent . getUOWCoord ( ) ; if ( coord != null ) { if ( checkMarkedRollback && coord . getRollbackOnly ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Attempting to do work on a tx " + "that has been marked rollback." ) ; } throw new CSITransactionRolledbackException ( "Transaction rolled back" ) ; } } return ( SynchronizationRegistryUOWScope ) coord ; } | Added checkMarkedRollback parameter . d166414 |
38,915 | public void setRollbackOnly ( ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "setRollbackOnly" , this ) ; } LocalTransactionCoordinator lCoord = getLocalCoord ( ) ; if ( lCoord != null ) { lCoord . setRollbackOnly ( ) ; } else { try { txService . setRollbackOnly ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , CLASS_NAME + ".setRollbackOnly" , "556" , this ) ; throw new IllegalStateException ( "No active transaction" ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "setRollbackOnly" ) ; } } | Marks the current local or global transaction to be rolled back |
38,916 | public boolean getRollbackOnly ( ) { LocalTransactionCoordinator lCoord = getLocalCoord ( ) ; if ( lCoord != null ) { return ( lCoord . getRollbackOnly ( ) ) ; } else { int status = Status . STATUS_NO_TRANSACTION ; try { status = txService . getStatus ( ) ; } catch ( SystemException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".getRollbackOnly" , "667" , this ) ; } return ( status == Status . STATUS_MARKED_ROLLBACK || status == Status . STATUS_ROLLEDBACK || status == Status . STATUS_ROLLING_BACK ) ; } } | Returns true iff the current local or global transaction has been marked rollback only |
38,917 | public void enlistWithTransaction ( javax . transaction . Synchronization sync ) throws CSIException { SynchronizationRegistryUOWScope uowScope = getCurrentTransactionalUOW ( false ) ; if ( uowScope == null ) { throw new IllegalStateException ( "No active transaction" ) ; } enlistWithTransaction ( uowScope , sync ) ; } | Enlist synchronization instance with the current local or global transaction . |
38,918 | public void enlistWithTransaction ( SynchronizationRegistryUOWScope uowCoord , Synchronization sync ) throws CSIException { try { if ( uowCoord . getUOWType ( ) == UOWSynchronizationRegistry . UOW_TYPE_GLOBAL_TRANSACTION ) { ( ( Transaction ) uowCoord ) . registerSynchronization ( sync ) ; } else { ( ( LocalTransactionCoordinator ) uowCoord ) . enlistSynchronization ( sync ) ; } } catch ( Exception ex ) { throw new CSIException ( "Failed to enlist with transaction" , ex ) ; } } | Enlist synchronization instance with the specified UOWCoord |
38,919 | final LocalTransactionCoordinator beginLocalTx ( ) { LocalTransactionCoordinator lCoord = null ; try { ltcCurrent . begin ( ) ; lCoord = getLocalCoord ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) ) { if ( tc . isEventEnabled ( ) ) { if ( lCoord != null ) { Tr . event ( tc , "Began LTC cntxt: tid=" + Integer . toHexString ( lCoord . hashCode ( ) ) + "(LTC)" ) ; } else { Tr . event ( tc , "Began LTC cntxt: " + "null Coordinator!" ) ; } } if ( lCoord != null && TETxLifeCycleInfo . isTraceEnabled ( ) ) { TETxLifeCycleInfo . traceLocalTxBegin ( "" + System . identityHashCode ( lCoord ) , "Begin Local Tx" ) ; } } } catch ( Exception ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".beginLocalTx" , "737" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Begin local tx failed" , ex ) ; } } return ( lCoord ) ; } | Begin a new local trasaction context |
38,920 | final Transaction suspendGlobalTx ( int action ) throws CSIException { Transaction ctrl = null ; try { ctrl = txService . suspend ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) ) { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Suspending TX cntxt: " + ctrl ) ; if ( TETxLifeCycleInfo . isTraceEnabled ( ) ) { String idStr = null ; if ( ctrl != null ) idStr = ctrl . toString ( ) ; int idx ; idStr = ( idStr != null ) ? ( ( ( idx = idStr . indexOf ( "(" ) ) != - 1 ) ? idStr . substring ( idx + 1 , idStr . indexOf ( ")" ) ) : ( ( idx = idStr . indexOf ( "tid=" ) ) != - 1 ) ? idStr . substring ( idx + 4 ) : idStr ) : "NoTx" ; TETxLifeCycleInfo . traceGlobalTxSuspend ( idStr , "Suspend Global Tx" ) ; } } } catch ( SystemException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".setRollbackOnly" , "770" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Error suspending global tx" , e ) ; throw new CSIException ( "suspend global tx failed" , e ) ; } if ( ctrl != null ) { int txtype = ( ( UOWCoordinator ) ctrl ) . getTxType ( ) ; if ( txtype == UOWCoordinator . TXTYPE_NONINTEROP_GLOBAL ) return ctrl ; } return ctrl ; } | Suspend the current global transaction and return the Control instance for it ; the inactivity timeout is either started or stopped according to action . If no global transaction exists on the thread do nothing ; returned Control object will be null is this case |
38,921 | final void resumeGlobalTx ( Transaction ctrl , int action ) throws SystemException , InvalidTransactionException { try { txService . resume ( ctrl ) ; } catch ( SystemException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".resumeGlobalTx" , "814" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Error resuming global tx" , e ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) ) { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Resumed TX cntxt: " + txService . getTransaction ( ) ) ; if ( TETxLifeCycleInfo . isTraceEnabled ( ) ) { String idStr = null ; if ( ctrl != null ) idStr = ctrl . toString ( ) ; int idx ; idStr = ( idStr != null ) ? ( ( ( idx = idStr . indexOf ( "(" ) ) != - 1 ) ? idStr . substring ( idx + 1 , idStr . indexOf ( ")" ) ) : ( ( idx = idStr . indexOf ( "tid=" ) ) != - 1 ) ? idStr . substring ( idx + 4 ) : idStr ) : "NoTx" ; TETxLifeCycleInfo . traceGlobalTxResume ( idStr , "Resume Global Tx" ) ; } } if ( ctrl != null && ( ( UOWCoordinator ) ctrl ) . getTxType ( ) == UOWCoordinator . TXTYPE_NONINTEROP_GLOBAL ) return ; } | Resume the global transaction associated with the given Control instance . The inactivity timeout is either started or stopped according to action . If InvalidTransactionException is raised by the global tx service it is passed on to the caller of this method . |
38,922 | final public void completeTxTimeout ( ) throws CSITransactionRolledbackException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; try { if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "completeTxTimeout" ) ; } txService . completeTxTimeout ( ) ; } catch ( TransactionRolledbackException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".completeTxTimeout" , "1390" , this ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "completeTxTimeout throwing CSITransactionRolledBackException" ) ; } throw new CSITransactionRolledbackException ( "Transaction rolled back" , e ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "completeTxTimeout exit" ) ; } } | Complete processing of passive transaction timeout . The timer pops on a timeout thread ; the transaction is rolled back on the application thread when the container has control . d171654 |
38,923 | public boolean isBmtActive ( EJBMethodInfoImpl methodInfo ) { TranStrategy ts = txStrategies [ methodInfo . getTransactionAttribute ( ) . getValue ( ) ] ; return ts . isBmtActive ( ) ; } | 167937 - added entire method |
38,924 | public BundleList findExtraBundles ( BundleList newBundleList , FeatureManager featureManager ) { List < RuntimeFeatureResource > bundles = new ArrayList < RuntimeFeatureResource > ( resources ) ; bundles . removeAll ( newBundleList . resources ) ; resources . removeAll ( bundles ) ; BundleList result = new BundleList ( featureManager ) ; result . resources . addAll ( bundles ) ; stale . set ( true ) ; return result ; } | This is like retain all except it returns a list of what was removed . |
38,925 | @ FFDCIgnore ( NumberFormatException . class ) private void readWriteTimeAndJavaSpecVersion ( WsResource res , String line ) { int timeIndex = line . indexOf ( '=' ) ; int javaSpecVersionIndex = timeIndex >= 0 ? line . indexOf ( ';' , timeIndex ) : - 1 ; if ( timeIndex != - 1 ) { try { String sTime = javaSpecVersionIndex > timeIndex ? line . substring ( timeIndex + 1 , javaSpecVersionIndex ) : line . substring ( timeIndex + 1 ) ; writeTime = Long . parseLong ( sTime ) ; if ( javaSpecVersionIndex != - 1 ) { javaSpecVersion = Integer . valueOf ( line . substring ( javaSpecVersionIndex + 1 ) ) ; } } catch ( NumberFormatException nfe ) { } } if ( writeTime <= 0 ) { writeTime = res . getLastModified ( ) ; } } | ignore the NumberFormatException as we deal with it . |
38,926 | public synchronized void add ( int id , SICoreConnection connection ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "add" , "" + id ) ; map . put ( id , connection ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "add" ) ; } | Adds an SICoreConnection into this map with the specified ID . |
38,927 | public synchronized SICoreConnection get ( int id ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "get" , "" + id ) ; SICoreConnection retValue = ( SICoreConnection ) map . get ( id ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "get" , retValue ) ; return retValue ; } | Returns the SICoreConnection previously stored with the specified ID . |
38,928 | public synchronized void remove ( int id ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "remove" , "" + id ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "remove" , "" + id ) ; map . remove ( id ) ; } | Removes an SICoreConnection from the map . |
38,929 | public Selector resolve ( Selector tree , Resolver resolver , PositionAssigner positionAssigner ) { if ( tree instanceof Identifier ) { Identifier id = ( Identifier ) tree ; return resolver . resolve ( id , positionAssigner ) ; } else if ( tree . getNumIds ( ) > 0 ) { Operator oper = ( Operator ) tree ; for ( int i = 0 ; i < oper . getOperands ( ) . length ; i ++ ) oper . setOperand ( i , resolve ( oper . getOperands ( ) [ i ] , resolver , positionAssigner ) ) ; oper . assignType ( ) ; } return tree ; } | Walks a Selector tree and resolves all the Identifiers |
38,930 | private static Selector DNF0 ( Selector tree ) { if ( ! ( tree instanceof Operator ) ) return tree ; Operator oper = ( Operator ) tree ; switch ( oper . getOp ( ) ) { case Selector . AND : return processAND ( oper . getOperands ( ) [ 0 ] , oper . getOperands ( ) [ 1 ] ) ; case Selector . OR : return makeOR ( DNF0 ( oper . getOperands ( ) [ 0 ] ) , DNF0 ( oper . getOperands ( ) [ 1 ] ) ) ; default : return tree ; } } | Working recursive subroutine of DNF |
38,931 | private static Selector processAND ( Selector sel0 , Selector sel1 ) { sel0 = DNF0 ( sel0 ) ; sel1 = DNF0 ( sel1 ) ; if ( sel0 instanceof Operator ) { Operator oper = ( Operator ) sel0 ; if ( oper . getOp ( ) == Selector . OR ) return makeOR ( processAND ( oper . getOperands ( ) [ 0 ] , sel1 ) , processAND ( oper . getOperands ( ) [ 1 ] , sel1 ) ) ; } return processANDRight ( sel0 , sel1 ) ; } | Subroutine of DNF0 to process AND nodes |
38,932 | private static Selector processANDRight ( Selector sel0 , Selector sel1 ) { if ( sel1 instanceof Operator ) { Operator oper = ( Operator ) sel1 ; if ( oper . getOp ( ) == Selector . OR ) return makeOR ( processANDRight ( sel0 , oper . getOperands ( ) [ 0 ] ) , processANDRight ( sel0 , oper . getOperands ( ) [ 1 ] ) ) ; } return makeAND ( sel0 , sel1 ) ; } | Subroutine of DNF0 to process AND nodes whose left child is an atom |
38,933 | private static Selector makeOR ( Selector sel0 , Selector sel1 ) { if ( sel0 . getNumIds ( ) == 0 ) { Boolean staticResult = ( Boolean ) Matching . getEvaluator ( ) . eval ( sel0 ) ; if ( staticResult != null && staticResult . booleanValue ( ) ) return new LiteralImpl ( Boolean . TRUE ) ; else return evalOf ( sel1 ) ; } if ( sel1 . getNumIds ( ) == 0 ) { Boolean staticResult = ( Boolean ) Matching . getEvaluator ( ) . eval ( sel1 ) ; if ( staticResult != null && staticResult . booleanValue ( ) ) return new LiteralImpl ( Boolean . TRUE ) ; else return evalOf ( sel0 ) ; } return new OperatorImpl ( Operator . OR , sel0 , sel1 ) ; } | must be true . |
38,934 | private static Selector makeAND ( Selector sel0 , Selector sel1 ) { if ( sel0 . getNumIds ( ) == 0 ) { Boolean staticResult = ( Boolean ) Matching . getEvaluator ( ) . eval ( sel0 ) ; if ( staticResult == null || ! staticResult . booleanValue ( ) ) return new LiteralImpl ( Boolean . FALSE ) ; else return evalOf ( sel1 ) ; } if ( sel1 . getNumIds ( ) == 0 ) { Boolean staticResult = ( Boolean ) Matching . getEvaluator ( ) . eval ( sel1 ) ; if ( staticResult == null || ! staticResult . booleanValue ( ) ) return new LiteralImpl ( Boolean . FALSE ) ; else return evalOf ( sel0 ) ; } return new OperatorImpl ( Operator . AND , sel0 , sel1 ) ; } | must be false . |
38,935 | private static Selector evalOf ( Selector arg ) { if ( arg . getNumIds ( ) > 0 ) return arg ; return new LiteralImpl ( Matching . getEvaluator ( ) . eval ( arg ) ) ; } | if the argument has no identifiers |
38,936 | private static Selector simplifyTree ( Selector tree ) { if ( ! ( tree instanceof Operator ) || tree instanceof ExtensionOperatorImpl ) return tree ; Operator oper = ( Operator ) tree ; switch ( oper . getOp ( ) ) { case Selector . NOT : return simplifyNOT ( oper . getOperands ( ) [ 0 ] ) ; case Selector . EQ : return simplifyEQ ( oper . getOperands ( ) [ 0 ] , oper . getOperands ( ) [ 1 ] ) ; case Selector . NE : return simplifyNE ( oper . getOperands ( ) [ 0 ] , oper . getOperands ( ) [ 1 ] ) ; case Selector . NEG : case Selector . ISNULL : return new OperatorImpl ( oper . getOp ( ) , simplifyTree ( oper . getOperands ( ) [ 0 ] ) ) ; case Selector . LIKE : case Selector . TOPIC_LIKE : LikeOperatorImpl loper = ( LikeOperatorImpl ) oper ; return new LikeOperatorImpl ( loper . getOp ( ) , simplifyTree ( loper . getOperands ( ) [ 0 ] ) , loper . getInternalPattern ( ) , loper . getPattern ( ) , loper . isEscaped ( ) , loper . getEscape ( ) ) ; default : return new OperatorImpl ( oper . getOp ( ) , simplifyTree ( oper . getOperands ( ) [ 0 ] ) , simplifyTree ( oper . getOperands ( ) [ 1 ] ) ) ; } } | and OR nodes |
38,937 | private static Selector simplifyNOT ( Selector tree ) { if ( tree instanceof Literal ) return new LiteralImpl ( EvaluatorImpl . not ( ( Boolean ) ( ( Literal ) tree ) . getValue ( ) ) ) ; if ( ! ( tree instanceof Operator ) ) return new OperatorImpl ( Selector . NOT , tree ) ; Operator oper = ( Operator ) tree ; switch ( oper . getOp ( ) ) { case Selector . NOT : return simplifyTree ( oper . getOperands ( ) [ 0 ] ) ; case Selector . AND : return makeOR ( simplifyNOT ( oper . getOperands ( ) [ 0 ] ) , simplifyNOT ( oper . getOperands ( ) [ 1 ] ) ) ; case Selector . OR : return makeAND ( simplifyNOT ( oper . getOperands ( ) [ 0 ] ) , simplifyNOT ( oper . getOperands ( ) [ 1 ] ) ) ; case Selector . EQ : return simplifyNE ( oper . getOperands ( ) [ 0 ] , oper . getOperands ( ) [ 1 ] ) ; case Selector . NE : return simplifyEQ ( oper . getOperands ( ) [ 0 ] , oper . getOperands ( ) [ 1 ] ) ; case Selector . GT : return new OperatorImpl ( Selector . LE , oper . getOperands ( ) [ 0 ] , oper . getOperands ( ) [ 1 ] ) ; case Selector . LT : return new OperatorImpl ( Selector . GE , oper . getOperands ( ) [ 0 ] , oper . getOperands ( ) [ 1 ] ) ; case Selector . GE : return new OperatorImpl ( Selector . LT , oper . getOperands ( ) [ 0 ] , oper . getOperands ( ) [ 1 ] ) ; case Selector . LE : return new OperatorImpl ( Selector . GT , oper . getOperands ( ) [ 0 ] , oper . getOperands ( ) [ 1 ] ) ; default : return new OperatorImpl ( Selector . NOT , tree ) ; } } | Subroutine of simplifyTree to handle NOT nodes |
38,938 | private static Selector simplifyEQ ( Selector sel0 , Selector sel1 ) { if ( sel0 . getType ( ) != Selector . BOOLEAN ) return new OperatorImpl ( Selector . EQ , sel0 , sel1 ) ; else return makeOR ( makeAND ( simplifyTree ( sel0 ) , simplifyTree ( sel1 ) ) , makeAND ( simplifyNOT ( sel0 ) , simplifyNOT ( sel1 ) ) ) ; } | Subroutine of simplifyTree to handle EQ nodes |
38,939 | private static Selector simplifyNE ( Selector sel0 , Selector sel1 ) { if ( sel0 . getType ( ) == Selector . BOOLEAN ) return makeOR ( makeAND ( simplifyTree ( sel0 ) , simplifyNOT ( sel1 ) ) , makeAND ( simplifyNOT ( sel0 ) , simplifyTree ( sel1 ) ) ) ; else if ( sel0 . getType ( ) == Selector . STRING || sel0 . getType ( ) == Selector . UNKNOWN ) return new OperatorImpl ( Selector . NE , sel0 , sel1 ) ; else return makeOR ( new OperatorImpl ( Selector . LT , sel0 , sel1 ) , new OperatorImpl ( Selector . GT , sel0 , sel1 ) ) ; } | Subroutine of simplifyTree to handle NE nodes |
38,940 | private static boolean augmentConjunction ( ConjunctionImpl target , Selector toAdd ) { if ( toAdd instanceof Operator ) { Operator oper = ( Operator ) toAdd ; if ( oper . getOp ( ) == Selector . AND ) return augmentConjunction ( target , oper . getOperands ( ) [ 0 ] ) && augmentConjunction ( target , oper . getOperands ( ) [ 1 ] ) ; } if ( toAdd . getNumIds ( ) == 0 ) { Boolean theEval = ( Boolean ) Matching . getEvaluator ( ) . eval ( toAdd ) ; if ( theEval == null ) return false ; else return theEval . booleanValue ( ) ; } else if ( Matching . isSimple ( toAdd ) ) { if ( toAdd . isExtended ( ) ) return target . and ( new ExtendedSimpleTestImpl ( toAdd ) ) ; else return target . and ( new SimpleTestImpl ( toAdd ) ) ; } else { target . and ( toAdd ) ; return true ; } } | or false if the Conjunction will always be false . |
38,941 | public static String getRandomAlphaNumeric ( int length ) { if ( length <= 0 ) { return "" ; } Random r = getRandom ( ) ; StringBuffer result = new StringBuffer ( length ) ; for ( int i = 0 ; i < length ; i ++ ) { int n = r . nextInt ( alphaNumChars . length ) ; result . append ( alphaNumChars [ n ] ) ; } return result . toString ( ) ; } | Generates a random alphanumeric string of length n . |
38,942 | static String getLogHeader ( Map < String , String > config ) { StringBuilder builder = new StringBuilder ( 512 ) ; String productInfo = config . get ( "websphere.product.info" ) ; if ( productInfo != null ) { builder . append ( "product = " ) . append ( productInfo ) . append ( LoggingConstants . nl ) ; } String installDir = config . get ( "wlp.install.dir" ) ; if ( installDir != null ) { builder . append ( "wlp.install.dir = " ) . append ( installDir ) . append ( LoggingConstants . nl ) ; } String serverConfigDir = config . get ( "server.config.dir" ) ; if ( serverConfigDir != null && ! "true" . equals ( config . get ( "wlp.user.dir.isDefault" ) ) ) { builder . append ( "server.config.dir = " ) . append ( serverConfigDir ) . append ( LoggingConstants . nl ) ; } String serverOutputDir = config . get ( "server.output.dir" ) ; if ( serverOutputDir != null && ! serverOutputDir . equals ( serverConfigDir ) ) { builder . append ( "server.output.dir = " ) . append ( serverOutputDir ) . append ( LoggingConstants . nl ) ; } builder . append ( "java.home = " ) . append ( System . getProperty ( "java.home" ) ) . append ( LoggingConstants . nl ) ; builder . append ( "java.version = " ) . append ( System . getProperty ( "java.version" ) ) . append ( LoggingConstants . nl ) ; builder . append ( "java.runtime = " ) . append ( System . getProperty ( "java.runtime.name" ) ) . append ( " (" ) . append ( System . getProperty ( "java.runtime.version" ) ) . append ( ')' ) . append ( LoggingConstants . nl ) ; builder . append ( "os = " ) . append ( System . getProperty ( "os.name" ) ) . append ( " (" ) . append ( System . getProperty ( "os.version" ) ) . append ( "; " ) . append ( System . getProperty ( "os.arch" ) ) . append ( ") (" ) . append ( Locale . getDefault ( ) ) . append ( ")" ) . append ( LoggingConstants . nl ) ; builder . append ( "process = " ) ; String pid = System . getProperty ( "sun.java.launcher.pid" ) ; if ( pid != null ) { try { String ip = InetAddress . getLocalHost ( ) . getHostAddress ( ) ; builder . append ( pid ) . append ( '@' ) . append ( ip ) ; } catch ( Exception e ) { pid = null ; } } if ( pid == null ) { builder . append ( ManagementFactory . getRuntimeMXBean ( ) . getName ( ) ) ; } builder . append ( LoggingConstants . nl ) ; return builder . toString ( ) ; } | Returns the header to be written at the beginning of all log files . |
38,943 | public synchronized void init ( LogProviderConfig config ) { ffdcSummaryPolicy = ( ( LogProviderConfigImpl ) config ) . getFfdcSummaryPolicy ( ) ; update ( config ) ; } | Initialize the FFDC service based on the provided configuration |
38,944 | public synchronized void update ( LogProviderConfig config ) { File location = config . getLogDirectory ( ) ; if ( location == null ) { location = new File ( "." ) ; } location = new File ( location , FFDCConfigurator . FFDC_DIR ) ; ffdcLogDirectory = location ; int maxFiles = config . getMaxFiles ( ) ; Object token = ThreadIdentityManager . runAsServer ( ) ; try { summaryLogSet . update ( location , FFDCConfigurator . FFDC_SUMMARY_FILE_NAME , FFDCConfigurator . FFDC_EXTENSION , maxFiles ) ; synchronized ( ffdcLogSet ) { ffdcLogSet . update ( location , FFDCConfigurator . FFDC_FILE_NAME , FFDCConfigurator . FFDC_EXTENSION , 0 ) ; } } finally { ThreadIdentityManager . reset ( token ) ; } } | Update the FFDC service based on the provided configuration |
38,945 | public synchronized void stop ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Stopping the basic FFDC service" ) ; } logSummary ( true ) ; } | Stop this FFDC service instance and free up any resources currently used . |
38,946 | public void processException ( Throwable th , String sourceId , String probeId , Object callerThis , Object [ ] objectArray ) { log ( sourceId , probeId , th , callerThis , objectArray ) ; } | Process an exception |
38,947 | @ FFDCIgnore ( PrivilegedActionException . class ) private void log ( String sourceId , String probeId , Throwable th , Object callerThis , Object [ ] objectArray ) { IncidentImpl incident = getIncident ( sourceId , probeId , th , callerThis , objectArray ) ; incident . log ( th , callerThis , objectArray ) ; if ( System . getSecurityManager ( ) == null ) { logSummary ( ffdcSummaryPolicy == FFDCSummaryPolicy . IMMEDIATE ) ; } else { AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { public Void run ( ) { logSummary ( ffdcSummaryPolicy == FFDCSummaryPolicy . IMMEDIATE ) ; return null ; } } ) ; } for ( IncidentForwarder forwarder : FFDC . getIncidentForwarders ( ) ) { forwarder . process ( incident , th ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "FFDC exception: " + th ) ; } | Log a problem to the global incident stream ( creating it if necessary |
38,948 | private OutputStream createSummaryStream ( File targetFile ) throws IOException { if ( targetFile == null ) return null ; TextFileOutputStreamFactory factory = FFDCConfigurator . getFileOutputStreamFactory ( ) ; OutputStream newStream = null ; Object token = ThreadIdentityManager . runAsServer ( ) ; try { newStream = factory . createOutputStream ( targetFile ) ; } finally { ThreadIdentityManager . reset ( token ) ; } return newStream ; } | This wrapper method for creating streams should be called while synchronized on the targetFile .. |
38,949 | public void alertClose ( ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "alertClose" , " _outWriter: + _outWriter ) ; writerClosed = true ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "alertClose" , "exit" ) ; } | Alert message that the outputstream has been closed . |
38,950 | public void alertException ( ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "alertException" , "entry _outWriter: + _outWriter ) ; writerException = true ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "alertException" , "exit" ) ; } | Alert message that there has been an exception in the outputstream . |
38,951 | public boolean writerObtained ( ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "writerObtained" , " " + String . valueOf ( _gotWriter ) , "[" + this + "]" ) ; return _gotWriter ; } | Used to check whether the writer has been obtained . |
38,952 | public boolean outputStreamObtained ( ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "outputStreamObtained" , " " + String . valueOf ( _gotOutputStream ) , "[" + this + "]" ) ; return _gotOutputStream ; } | Used to check whether the output stream has been obtained . |
38,953 | public void finish ( ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . entering ( CLASS_NAME , "finish" , "[" + this + "]" ) ; if ( ! isCommitted ( ) ) { commit ( ) ; } try { flushBuffer ( false ) ; _rawOut . close ( ) ; } catch ( IOException e ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "finish" , "Servlet.Exception:.Error.while.finishing.response" , e ) ; } } finally { _rawOut . reset ( ) ; cleanupFromFinish ( ) ; _bufferedWriter . reset ( ) ; } resetState ( ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . exiting ( CLASS_NAME , "finish" ) ; } | Close this response . |
38,954 | protected void cleanupFromFinish ( ) { _response = null ; _bufferSize = 0 ; _encoding = null ; _gotOutputStream = false ; _gotWriter = false ; this . _pwriter = null ; } | shared cleanup from finish & finishKeepConnection |
38,955 | public void resetBuffer ( ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . entering ( CLASS_NAME , "resetBuffer" , "[" + this + "]" ) ; if ( isCommitted ( ) ) throw new IllegalStateException ( ) ; if ( _gotOutputStream ) { _response . resetBuffer ( ) ; } if ( _bufferedWriter != null ) { _bufferedWriter . clearBuffer ( ) ; } _firstWriteToCurrentBuffer = false ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . exiting ( CLASS_NAME , "resetBuffer" ) ; } | Clears the content of the underlying buffer in the response without clearing headers or status code . |
38,956 | public ServletOutputStream getOutputStream ( ) { final boolean isTraceOn = com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && logger . isLoggable ( Level . FINE ) ) logger . entering ( CLASS_NAME , "getOutputStream" , "gotWriter=" + String . valueOf ( _gotWriter ) + " [" + this + "]" ) ; if ( ! _ignoreStateErrors && _gotWriter ) { if ( isTraceOn && logger . isLoggable ( Level . FINE ) ) logger . exiting ( CLASS_NAME , "getOutputStream" , "throw IllegalStateException" ) ; throw new IllegalStateException ( nls . getString ( "Writer.already.obtained" , "Writer already obtained" ) ) ; } if ( ! ( WCCustomProperties . FINISH_RESPONSE_ON_CLOSE ) || ! _gotOutputStream ) { _gotOutputStream = true ; } this . fireOutputStreamRetrievedEvent ( _bufferedOut ) ; if ( isTraceOn && logger . isLoggable ( Level . FINE ) ) logger . exiting ( CLASS_NAME , "getOutputStream" ) ; return _bufferedOut ; } | Returns an output stream for writing binary response data . |
38,957 | public PrintWriter getWriter ( ) throws IOException , UnsupportedEncodingException { final boolean isTraceOn = com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && logger . isLoggable ( Level . FINE ) ) logger . entering ( CLASS_NAME , "getWriter" , "gotOutputStream=" + String . valueOf ( _gotOutputStream ) + " [" + this + "]" ) ; if ( ! _ignoreStateErrors && _gotOutputStream ) { if ( isTraceOn && logger . isLoggable ( Level . FINE ) ) logger . exiting ( CLASS_NAME , "getWriter" , "throw IllegalStateException" ) ; throw new IllegalStateException ( nls . getString ( "OutputStream.already.obtained" , "OutputStream already obtained" ) ) ; } if ( ! _gotWriter ) { String charEncoding = getCharacterEncoding ( ) ; if ( contentTypeCompatibility == null || ( ! contentTypeCompatibility . equalsIgnoreCase ( "V4" ) && ! contentTypeCompatibility . equalsIgnoreCase ( "V5" ) ) ) { String contentType = getContentType ( ) ; if ( contentType != null && contentType . indexOf ( "charset" ) == - 1 && contentType . startsWith ( WebContainerConstants . TEXT ) ) { if ( contentType . endsWith ( ";" ) ) setContentType ( contentType + "charset=" + charEncoding ) ; else setContentType ( contentType + ";charset=" + charEncoding ) ; } } if ( ( _outWriter == null ) || ( writerException == true ) || ( ! charEncoding . equals ( _outWriterEncoding ) ) ) { if ( isTraceOn && logger . isLoggable ( Level . FINE ) && writerException ) { logger . logp ( Level . FINE , CLASS_NAME , "getWriter" , "writerException + writerException + " ) ; } _outWriter = new OutputStreamWriter ( _rawOut , EncodingUtils . getJvmConverter ( charEncoding ) ) ; _outWriterEncoding = charEncoding ; writerException = false ; } else { if ( isTraceOn && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getWriter" , "reusing _outWriter: + _outWriter ) ; } } if ( isTraceOn && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "getWriter" , "created writer with encoding: " + _outWriter . getEncoding ( ) ) ; _bufferedWriter . init ( _outWriter , getBufferSize ( ) ) ; _bufferedWriter . setLimitLong ( _contentLength ) ; _bufferedWriter . setResponse ( _response ) ; _pwriter = new PrintWriter ( _bufferedWriter , false ) ; _gotWriter = true ; writerClosed = false ; } this . fireWriterRetrievedEvent ( _pwriter ) ; if ( isTraceOn && logger . isLoggable ( Level . FINE ) ) logger . exiting ( CLASS_NAME , "getWriter" ) ; return _pwriter ; } | Returns a PrintWriter for writing formatted text output . |
38,958 | public void addCookie ( Cookie cookie ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "addCookie" , "Adding cookie + cookie . getName ( ) , "[" + this + "]" ) ; } WebAppDispatcherContext dispatchContext = ( WebAppDispatcherContext ) getRequest ( ) . getWebAppDispatcherContext ( ) ; if ( dispatchContext . isInclude ( ) == true ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "addCookie" , nls . getString ( "Illegal.from.included.servlet" , "Illegal from included servlet" ) , "addCookie cookie + cookie . getName ( ) ) ; } else { if ( ! _ignoreStateErrors && isCommitted ( ) ) { IServletWrapper wrapper = dispatchContext . getCurrentServletReference ( ) ; if ( logWarningActionNow ( wrapper ) ) { logAlreadyCommittedWarning ( new Throwable ( ) , "addCookie" ) ; } else { logger . logp ( Level . FINE , CLASS_NAME , "addCookie" , "Cannot set header. Response already committed." ) ; } } else { _response . addCookie ( cookie ) ; } } } | Uses the given HTTP response message to assign a new value to a browser - specific cookie . Updates the response to restrict caching of sensitive cookie - related data . |
38,959 | synchronized protected void commit ( ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . entering ( CLASS_NAME , "commit" , "[" + this + "] ,_headersWritten + _headersWritten ) ; } if ( ! _headersWritten && ! isCommitted ( ) ) { addLocaleHeader ( ) ; if ( containsHeader ( HEADER_CONTENT_ENCODING ) && containsHeader ( HEADER_CONTENT_LENGTH ) ) { if ( keepContentLength ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "commit" , "WebContainer custom property set to keep Content-Length header w/presence of Content-Encoding header" ) ; } } else { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "commit" , "Content-Length header disallowed w/presence of Content-Encoding header" ) ; } removeHeader ( HEADER_CONTENT_LENGTH ) ; } } WebContainer . notifyHttpServletResponseListenersPreHeaderCommit ( ( HttpServletRequest ) _connContext . getRequest ( ) , this ) ; String scheme = this . getRequest ( ) . getScheme ( ) ; if ( scheme != null && scheme . equalsIgnoreCase ( "https" ) ) { addSTSHeader ( ) ; } _response . prepareHeadersForWrite ( ) ; _headersWritten = true ; if ( this . _bufferedOut != null && this . _bufferedOut instanceof WCOutputStream ) { HttpOutputStreamConnectWeb output = ( ( WCOutputStream ) this . _bufferedOut ) . getOutput ( ) ; output . setWebC_headersWritten ( true ) ; String remoteUser = _connContext . getRequest ( ) . getRemoteUser ( ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "commit" , "Setting remote user : " + remoteUser ) ; } output . setWC_remoteUser ( remoteUser ) ; ( ( ( WCOutputStream ) this . _bufferedOut ) . getOutput ( ) ) . setWebC_headersWritten ( true ) ; } } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "commit" ) ; } } | Commits the response by sending response codes and headers . A response may only be commited once . |
38,960 | public String getCharacterEncoding ( ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . entering ( CLASS_NAME , "getCharacterEncoding" , "[" + this + "]" ) ; } if ( _encoding == null ) { setDefaultResponseEncoding ( ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "getCharacterEncoding" , " encoding + _encoding ) ; } return _encoding ; } | Returns the character encoding used for writing text to the body of this response . |
38,961 | public Cookie [ ] getCookies ( ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "getCookies" , "[" + this + "]" ) ; } return ( _response . getCookies ( ) ) ; } | Get the Cookies that have been set in this response . |
38,962 | public void sendError ( int status ) throws IOException { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "sendError" , "error + String . valueOf ( status ) , "[" + this + "]" ) ; } Object [ ] args = { new Integer ( status ) } ; sendError ( status , MessageFormat . format ( nls . getString ( "Error.reported.{0}" , "Error reported: {0}" ) , args ) ) ; } | Sends an error response to the client using the specified status code and no default message . |
38,963 | public void sendError ( int status , String msg ) throws IOException { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . entering ( CLASS_NAME , "sendError" , "status + status + " " + msg + " [" + this + "]" ) ; } WebAppDispatcherContext dispatchContext = ( WebAppDispatcherContext ) getRequest ( ) . getWebAppDispatcherContext ( ) ; if ( ! WCCustomProperties . ALLOW_INCLUDE_SEND_ERROR && dispatchContext . isInclude ( ) ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "sendError" , nls . getString ( "Illegal.from.included.servlet" , "Illegal from included servlet" ) , "sendError + status + " with message + msg ) ; } } else { dispatchContext . sendError ( status , msg ) ; this . closeResponseOutput ( ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "sendError" ) ; } } | Sends an error response to the client using the specified status code and detail message . |
38,964 | public void setReason ( String msg ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "setReason" , " message + msg , "[" + this + "]" ) ; } _response . setReason ( msg ) ; } | Sends an error response directly to the client using the specified status code and detail message . |
38,965 | public void setContentLength ( int len ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . entering ( CLASS_NAME , "setContentLength" , "length + String . valueOf ( len ) + " [" + this + "]" ) ; } WebAppDispatcherContext dispatchContext = ( WebAppDispatcherContext ) getRequest ( ) . getWebAppDispatcherContext ( ) ; if ( dispatchContext . isInclude ( ) == true ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "setContentLength" , nls . getString ( "Illegal.from.included.servlet" , "Illegal from included servlet" ) , "setContentLength length + String . valueOf ( len ) ) ; } } else { if ( _response != null ) { if ( ! _response . isCommitted ( ) ) { _response . setContentLength ( len ) ; } } _contentLength = len ; _bufferedWriter . setLimitLong ( _contentLength ) ; setIntHeader ( HEADER_CONTENT_LENGTH , len ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "setContentLength" ) ; } } | Defines the content length for this response . This call must be made only once . Not setting the content length may cause significant performance degradation . |
38,966 | public void setDateHeader ( String name , long t ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . entering ( CLASS_NAME , "setDateHeader" , " name + name + " value + String . valueOf ( t ) + " [" + this + "]" ) ; } WebAppDispatcherContext dispatchContext = ( WebAppDispatcherContext ) getRequest ( ) . getWebAppDispatcherContext ( ) ; if ( dispatchContext . isInclude ( ) == true ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "setDateHeader" , nls . getString ( "Illegal.from.included.servlet" , "Illegal from included servlet" ) ) ; } } else { if ( ! _ignoreStateErrors && isCommitted ( ) ) { IServletWrapper wrapper = dispatchContext . getCurrentServletReference ( ) ; if ( logWarningActionNow ( wrapper ) ) { logAlreadyCommittedWarning ( new Throwable ( ) , "setDateHeader" ) ; } else { logger . logp ( Level . FINE , CLASS_NAME , "setDateHeader" , "Cannot set header. Response already committed." ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "setDateHeader" , "Response already committed" ) ; } return ; } _response . setDateHeader ( name , t ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "setDateHeader" ) ; } } | Adds a date header with the specified time . If this is called more than once the current value will replace the previous value . |
38,967 | protected boolean logWarningActionNow ( IServletWrapper w ) { if ( w instanceof IServletWrapperInternal ) { boolean firstTime = ( ( IServletWrapperInternal ) w ) . hitWarningStatus ( ) ; return firstTime ; } else { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "logWarningActionNow" , "Not dealing with internal wrapper" ) ; } return true ; } } | Do not sync for performance reasons . It is ok to print this warning more than once just trying to limit it for the most part . |
38,968 | public void setInternalHeader ( String name , String s ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "setInternalHeader" , " name + name + " value + s , "[" + this + "]" ) ; } setHeader ( name , s , false ) ; } | Adds a header field with the specified string value . Does not check to see if this is an include . If this is called more than once the current value will replace the previous value . |
38,969 | public void setStatus ( int status ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . entering ( CLASS_NAME , "setStatus" , " status + String . valueOf ( status ) + " [" + this + "]" ) ; } WebAppDispatcherContext dispatchContext = ( WebAppDispatcherContext ) getRequest ( ) . getWebAppDispatcherContext ( ) ; if ( dispatchContext . isInclude ( ) == true ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "setStatus" , nls . getString ( "Illegal.from.included.servlet" , "Illegal from included servlet" ) , "setStatus status + String . valueOf ( status ) ) ; } } else { if ( ! _ignoreStateErrors && isCommitted ( ) ) { logger . logp ( Level . WARNING , CLASS_NAME , "setStatus" , "Cannot.set.status.Response.already.committed" ) ; } else { if ( WCCustomProperties . RESET_BUFFER_ON_SET_STATUS ) resetBuffer ( ) ; _response . setStatusCode ( status ) ; _statusCode = status ; } } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "setStatus" ) ; } } | Sets the status code and a default message for this response . |
38,970 | public TransactionParticipant start ( PersistentTranId ptid , int flags ) throws XidUnknownException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "start" , new Object [ ] { "PersistentTranId=" + ptid , xaFlagsToString ( flags ) } ) ; TransactionParticipant retval = null ; if ( ( flags & XAResource . TMJOIN ) != 0 ) { retval = _associatedTrans . get ( ptid ) ; if ( retval == null ) { XidUnknownException xue = new XidUnknownException ( "XID_NOT_RECOGNISED_SIMS1007" , new Object [ ] { "start(XID,TMJOIN)" , ptid . toTMString ( ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot JOIN with this Xid. It has not previously been started!" , xue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" ) ; throw xue ; } } else if ( ( flags & XAResource . TMRESUME ) != 0 ) { synchronized ( _associationLock ) { retval = _suspendedTrans . remove ( ptid ) ; if ( retval == null ) { XidUnknownException xue = new XidUnknownException ( "XID_NOT_RECOGNISED_SIMS1007" , new Object [ ] { "start(XID,TMRESUME)" , ptid . toTMString ( ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot RESUME this Xid. It has not previously been SUSPENDED!" , xue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" ) ; throw xue ; } else { _associatedTrans . put ( ptid , retval ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" , "return=" + retval ) ; return retval ; } | using either the TMJOIN or TMRESUME flags . |
38,971 | public void start ( PersistentTranId ptid , TransactionParticipant participant ) throws XidAlreadyKnownException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "start" , new Object [ ] { "PersistentTranId=" + ptid , "Participant=" + participant } ) ; synchronized ( _associationLock ) { if ( ! _associatedTrans . containsKey ( ptid ) && ! _unassociatedTrans . containsKey ( ptid ) && ! _suspendedTrans . containsKey ( ptid ) ) { _associatedTrans . put ( ptid , participant ) ; } else { XidAlreadyKnownException xake = new XidAlreadyKnownException ( "XID_ALREADY_ASSOCIATED_SIMS1009" , new Object [ ] { "start(XID,TMNOFLAGS)" , ptid . toTMString ( ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot start new association with this Xid. It is already known!" , xake ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" ) ; throw xake ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" ) ; } | with a NEW transaction branch . |
38,972 | public void end ( PersistentTranId ptid , int flags ) throws XidUnknownException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "end" , new Object [ ] { "PersistentTranId=" + ptid , xaFlagsToString ( flags ) } ) ; synchronized ( _associationLock ) { TransactionParticipant tran = _associatedTrans . remove ( ptid ) ; if ( tran != null ) { if ( ( flags & XAResource . TMSUSPEND ) != 0 ) { _suspendedTrans . put ( ptid , tran ) ; } else { _unassociatedTrans . put ( ptid , tran ) ; } } else { if ( _suspendedTrans . containsKey ( ptid ) ) { if ( ( ( flags & XAResource . TMSUCCESS ) != 0 ) || ( ( flags & XAResource . TMFAIL ) != 0 ) ) { tran = _suspendedTrans . remove ( ptid ) ; _unassociatedTrans . put ( ptid , tran ) ; } } else { if ( ! _unassociatedTrans . containsKey ( ptid ) ) { XidUnknownException xue = new XidUnknownException ( "XID_NOT_RECOGNISED_SIMS1007" , new Object [ ] { "end(XID)" , ptid . toTMString ( ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot disassociate from this Xid. It is not currently associated!" , xue ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "end" ) ; throw xue ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "end" ) ; } | later point . |
38,973 | public void restart ( PersistentMessageStore PM ) throws TransactionException , SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "restart" , "PersistenceManager=" + PM ) ; if ( PM != null ) { if ( PM instanceof PersistenceManager ) { _persistence = ( PersistenceManager ) PM ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "No PersistenceManager provided at startup. MessageStore cannot continue!" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "restart" ) ; throw new SevereMessageStoreException ( "UNRECOVERABLE_ERROR_SIMS1499" , new Object [ ] { } ) ; } try { List list = PM . readIndoubtXIDs ( ) ; Iterator iterator = list . iterator ( ) ; while ( iterator . hasNext ( ) ) { PersistentTranId ptid = ( PersistentTranId ) iterator . next ( ) ; _indoubtXids . add ( ptid ) ; synchronized ( _associationLock ) { _unassociatedTrans . put ( ptid , new XidParticipant ( _ms , ptid , _persistence , 0 , TransactionState . STATE_PREPARED ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Indoubt Transaction Re-instated from database: " + ptid ) ; } } catch ( PersistenceException pe ) { com . ibm . ws . ffdc . FFDCFilter . processException ( pe , "com.ibm.ws.sib.msgstore.transactions.XidManager.restart" , "1:516:1.62" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Persistence exception caught reading indoubt transactions from database!" , pe ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "restart" ) ; throw new TransactionException ( "UNEXPECTED_EXCEPTION_SIMS1099" , new Object [ ] { pe } , pe ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "PersistenceManager is null. MessageStore cannot continue!" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "restart" ) ; throw new SevereMessageStoreException ( "UNRECOVERABLE_ERROR_SIMS1499" , new Object [ ] { } ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "restart" ) ; } | Called at server startup to rebuild our list of indoubt transactions from the datastore . |
38,974 | public Xid [ ] recover ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "recover" ) ; Xid [ ] xids = new Xid [ _indoubtXids . size ( ) ] ; _indoubtXids . toArray ( xids ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "recover" , "return=" + Arrays . toString ( xids ) + ", size=" + xids . length ) ; return xids ; } | This method returns the list of indoubt Xids that the MessageStore knows about at the time . This includes those recovered from the datastore at restart time and any that are currently known about as part of normal runtime processing . |
38,975 | public Xid [ ] listRemoteInDoubts ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "listRemoteInDoubts" ) ; Vector < PersistentTranId > xids = ( Vector < PersistentTranId > ) _indoubtXids . clone ( ) ; Xid [ ] retval = null ; if ( xids . size ( ) > 0 ) { retval = new Xid [ xids . size ( ) ] ; xids . toArray ( retval ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "There are currently no in-doubt transaction branches within the ME." ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "listRemoteInDoubts" , "return=" + retval ) ; return retval ; } | This method returns a list representing all Xid known by the ME which do not match those currently known by the local Transaction Manager . The admin console can therefore use the output of this method to display a list of xids that can be completed through the ME admin console . |
38,976 | public String xaFlagsToString ( int flags ) { StringBuilder retval = new StringBuilder ( "Flags=" ) ; retval . append ( Integer . toHexString ( flags ) ) ; retval . append ( "( " ) ; if ( flags == XAResource . TMNOFLAGS ) { retval . append ( "TMNOFLAGS " ) ; } else { if ( ( flags & XAResource . TMENDRSCAN ) != 0 ) retval . append ( "TMENDRSCAN " ) ; if ( ( flags & XAResource . TMFAIL ) != 0 ) retval . append ( "TMFAIL " ) ; if ( ( flags & XAResource . TMJOIN ) != 0 ) retval . append ( "TMJOIN " ) ; if ( ( flags & XAResource . TMONEPHASE ) != 0 ) retval . append ( "TMONEPHASE " ) ; if ( ( flags & XAResource . TMRESUME ) != 0 ) retval . append ( "TMRESUME " ) ; if ( ( flags & XAResource . TMSTARTRSCAN ) != 0 ) retval . append ( "TMSTARTRSCAN " ) ; if ( ( flags & XAResource . TMSUCCESS ) != 0 ) retval . append ( "TMSUCCESS " ) ; if ( ( flags & XAResource . TMSUSPEND ) != 0 ) retval . append ( "TMSUSPEND " ) ; } retval . append ( ")" ) ; return retval . toString ( ) ; } | Feature SIB0048c . ms . 1 |
38,977 | public void assign ( Identifier id ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "assign" , "identifier: " + id ) ; String key = null ; switch ( id . getType ( ) ) { case Identifier . STRING : key = "S:" + id . getFullName ( ) ; break ; case Identifier . BOOLEAN : key = "B:" + id . getFullName ( ) ; break ; case Identifier . CHILD : key = "C:" + id . getFullName ( ) ; break ; case Identifier . TOPIC : key = "T:" + id . getFullName ( ) ; break ; case Identifier . UNKNOWN : case Identifier . OBJECT : key = "U:" + id . getFullName ( ) ; break ; default : key = "N:" + id . getFullName ( ) ; } Integer level = new Integer ( id . getStep ( ) ) ; LevelEntry positions = ( LevelEntry ) levels . get ( level ) ; if ( positions == null ) { positions = new LevelEntry ( ) ; levels . put ( level , positions ) ; } int levelPos = 0 ; if ( key != null ) { levelPos = positions . getPosition ( key ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) tc . debug ( this , cclass , "assign" , "level: " + level + ", levelPos: " + Integer . valueOf ( levelPos ) + ", for key: " + key ) ; OrdinalPosition ordPos = new OrdinalPosition ( level . intValue ( ) , levelPos ) ; id . setOrdinalPosition ( ordPos ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "assign" ) ; } | Implement the assignPosition method |
38,978 | public static void processBndAndExt ( Map < JNDIEnvironmentRefType , Map < String , String > > allBindings , Map < String , String > envEntryValues , ResourceRefConfigList resRefList , RefBindingsGroup refBindingsGroup , List < com . ibm . ws . javaee . dd . commonext . ResourceRef > resRefExts ) { RefBndAndExtHelper . configureEJBRefBindings ( refBindingsGroup , allBindings . get ( JNDIEnvironmentRefType . EJBRef ) ) ; RefBndAndExtHelper . configureMessageDestinationRefBindings ( refBindingsGroup , allBindings . get ( JNDIEnvironmentRefType . MessageDestinationRef ) ) ; RefBndAndExtHelper . configureResourceRefBindings ( refBindingsGroup , allBindings . get ( JNDIEnvironmentRefType . ResourceRef ) , resRefList ) ; if ( resRefExts != null ) { RefBndAndExtHelper . configureResourceRefExtensions ( resRefExts , resRefList ) ; } RefBndAndExtHelper . configureResourceEnvRefBindings ( refBindingsGroup , allBindings . get ( JNDIEnvironmentRefType . ResourceEnvRef ) ) ; RefBndAndExtHelper . configureEnvEntryBindings ( refBindingsGroup , envEntryValues , allBindings . get ( JNDIEnvironmentRefType . EnvEntry ) ) ; RefBndAndExtHelper . configureDataSourceBindings ( refBindingsGroup , allBindings . get ( JNDIEnvironmentRefType . DataSource ) ) ; } | Process bindings and extensions for all JNDIEnvironmentRef . This method can be called multiple times with different source objects . |
38,979 | static void rcvStartSess ( CommsByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange , boolean restart ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvStartSess" , new Object [ ] { request , conversation , requestNumber , allocatedFromBufferPool , restart } ) ; short connectionObjectID = request . getShort ( ) ; short consumerObjectID = request . getShort ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "connectionObjectID" , connectionObjectID ) ; SibTr . debug ( tc , "consumerObjectID" , consumerObjectID ) ; } CATMainConsumer mainConsumer = ( ( CATMainConsumer ) ( ( ConversationState ) conversation . getAttachment ( ) ) . getObject ( consumerObjectID ) ) ; mainConsumer . start ( requestNumber , true , partOfExchange , null , restart ) ; request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvStartSess" ) ; } | Start the Synchronous Consumer Session provided by the client . |
38,980 | static void rcvStopSess ( CommsByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvStopSess" , new Object [ ] { request , conversation , "" + requestNumber , "" + allocatedFromBufferPool } ) ; short connectionObjectID = request . getShort ( ) ; short consumerObjectID = request . getShort ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "connectionObjectID" , connectionObjectID ) ; SibTr . debug ( tc , "consumerObjectID" , consumerObjectID ) ; } CATMainConsumer mainConsumer = ( ( CATMainConsumer ) ( ( ConversationState ) conversation . getAttachment ( ) ) . getObject ( consumerObjectID ) ) ; mainConsumer . stop ( requestNumber ) ; request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvStopSess" ) ; } | Stop the Synchronous Consumer Session provided by the client . |
38,981 | static void rcvRegisterAsyncConsumer ( CommsByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange , boolean stoppable ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvRegisterAsyncConsumer" , new Object [ ] { request , conversation , requestNumber , allocatedFromBufferPool , stoppable } ) ; short connectionObjectId = request . getShort ( ) ; short consumerObjectId = request . getShort ( ) ; short orderContextId = request . getShort ( ) ; short clientSessionId = request . getShort ( ) ; int maxActiveMessages = request . getInt ( ) ; long messageLockExpiry = request . getLong ( ) ; int maxBatchSize = request . getInt ( ) ; int maxSequentialFailures = 0 ; long hiddenMessageDelay = 0 ; if ( stoppable ) { maxSequentialFailures = request . getInt ( ) ; hiddenMessageDelay = request . getLong ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "connectionObjectID=" + connectionObjectId ) ; SibTr . debug ( tc , "consumerObjectID=" + consumerObjectId ) ; SibTr . debug ( tc , "orderContextID=" + orderContextId ) ; SibTr . debug ( tc , "clientSessionID=" + clientSessionId ) ; SibTr . debug ( tc , "maxActiveMessages=" + maxActiveMessages ) ; SibTr . debug ( tc , "messageLockExpiry=" + messageLockExpiry ) ; SibTr . debug ( tc , "maxBatchSize=" + maxBatchSize ) ; SibTr . debug ( tc , "maxSequentialFailures=" + maxSequentialFailures ) ; SibTr . debug ( tc , "hiddenMesageDelay=" + hiddenMessageDelay ) ; } ConversationState convState = ( ConversationState ) conversation . getAttachment ( ) ; CATMainConsumer mainConsumer = ( ( CATMainConsumer ) convState . getObject ( consumerObjectId ) ) ; OrderingContext orderContext = null ; if ( orderContextId != CommsConstants . NO_ORDER_CONTEXT ) { orderContext = ( ( CATOrderingContext ) convState . getObject ( orderContextId ) ) . getOrderingContext ( ) ; } mainConsumer . setClientSessionId ( clientSessionId ) ; mainConsumer . setAsynchConsumerCallback ( requestNumber , maxActiveMessages , messageLockExpiry , maxBatchSize , orderContext , stoppable , maxSequentialFailures , hiddenMessageDelay ) ; request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvRegisterAsyncConsumer" ) ; } | Register an asynchronous consumer for this consumer session . |
38,982 | static void rcvRequestMsgs ( CommsByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvRequestMsgs" , new Object [ ] { request , conversation , "" + requestNumber , "" + allocatedFromBufferPool } ) ; short connectionObjectID = request . getShort ( ) ; short consumerObjectID = request . getShort ( ) ; int receivedBytes = request . getInt ( ) ; int requestedBytes = request . getInt ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "connectionObjectID" , connectionObjectID ) ; SibTr . debug ( tc , "consumerObjectID" , consumerObjectID ) ; SibTr . debug ( tc , "receivedBytes" , receivedBytes ) ; SibTr . debug ( tc , "requestedBytes" , requestedBytes ) ; } CATMainConsumer mainConsumer = ( ( CATMainConsumer ) ( ( ConversationState ) conversation . getAttachment ( ) ) . getObject ( consumerObjectID ) ) ; mainConsumer . requestMsgs ( requestNumber , receivedBytes , requestedBytes ) ; request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvRequestMsgs" ) ; } | Request messages for this consumer . |
38,983 | static void rcvSessReceive ( CommsServerByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvSessReceive" , new Object [ ] { request , conversation , "" + requestNumber , "" + allocatedFromBufferPool } ) ; ConversationState conversationState = ( ConversationState ) conversation . getAttachment ( ) ; ServerLinkLevelState linkState = ( ServerLinkLevelState ) conversation . getLinkLevelAttachment ( ) ; final boolean optimizedTx = CommsUtils . requiresOptimizedTransaction ( conversation ) ; short connectionObjectID = request . getShort ( ) ; short consumerObjectID = request . getShort ( ) ; int transactionObjectId = request . getSITransactionId ( connectionObjectID , linkState , optimizedTx ) ; long timeout = request . getLong ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "connectionObjectID" , connectionObjectID ) ; SibTr . debug ( tc , "consumerObjectID" , consumerObjectID ) ; SibTr . debug ( tc , "transaction Id" , transactionObjectId ) ; SibTr . debug ( tc , "timeout" , timeout ) ; } CATMainConsumer mainConsumer = ( CATMainConsumer ) conversationState . getObject ( consumerObjectID ) ; mainConsumer . receive ( requestNumber , transactionObjectId , timeout ) ; request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvSessReceive" ) ; } | Receive a message using the Synchronous Consumer Session provided by the client . |
38,984 | static void rcvUnlockAll ( CommsByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvUnlockAll" , new Object [ ] { request , conversation , "" + requestNumber , "" + allocatedFromBufferPool } ) ; short connectionObjectId = request . getShort ( ) ; short consumerObjectId = request . getShort ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "connectionObjectId" , connectionObjectId ) ; SibTr . debug ( tc , "consumerObjectId" , consumerObjectId ) ; } CATMainConsumer mainConsumer = ( CATMainConsumer ) ( ( ConversationState ) conversation . getAttachment ( ) ) . getObject ( consumerObjectId ) ; mainConsumer . unlockAll ( requestNumber ) ; request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvUnlockAll" ) ; } | Unlocks all locked messages on the server . |
38,985 | static void rcvDeleteSet ( CommsServerByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvDeleteSet" , new Object [ ] { request , conversation , "" + requestNumber } ) ; ServerLinkLevelState linkState = ( ServerLinkLevelState ) conversation . getLinkLevelAttachment ( ) ; final boolean optimizedTx = CommsUtils . requiresOptimizedTransaction ( conversation ) ; short connectionObjectId = request . getShort ( ) ; short consumerObjectId = request . getShort ( ) ; int transactionId = request . getSITransactionId ( connectionObjectId , linkState , optimizedTx ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "connectionObjectId" , connectionObjectId ) ; SibTr . debug ( tc , "consumerObjectId" , consumerObjectId ) ; SibTr . debug ( tc , "transactionId" , transactionId ) ; } SIMessageHandle [ ] siMsgHandles = request . getSIMessageHandles ( ) ; CATMainConsumer mainConsumer = ( CATMainConsumer ) ( ( ConversationState ) conversation . getAttachment ( ) ) . getObject ( consumerObjectId ) ; mainConsumer . deleteSet ( requestNumber , siMsgHandles , transactionId , partOfExchange ) ; request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvDeleteSet" ) ; } | Deletes a set of messages that are currently locked by the server . |
38,986 | static void rcvReadSet ( CommsByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvReadSet" , new Object [ ] { request , conversation , "" + requestNumber , "" + allocatedFromBufferPool } ) ; short connectionObjectId = request . getShort ( ) ; short consumerObjectId = request . getShort ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "connectionObjectId" , connectionObjectId ) ; SibTr . debug ( tc , "consumerObjectId" , consumerObjectId ) ; } SIMessageHandle [ ] msgHandles = request . getSIMessageHandles ( ) ; CATMainConsumer mainConsumer = ( CATMainConsumer ) ( ( ConversationState ) conversation . getAttachment ( ) ) . getObject ( consumerObjectId ) ; mainConsumer . readSet ( requestNumber , msgHandles ) ; request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvReadSet" ) ; } | Reads a set of messages that are currently locked by the server . |
38,987 | private void cleanupSubscription ( SubscriptionItemStream stream ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "cleanupSubscription" , stream ) ; try { stream . deleteIfPossible ( false ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.AsynchDeletionThread.cleanupSubscription" , "1:340:1.50" , stream ) ; if ( tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "Failed to delete subscription " + stream ) ; SibTr . exception ( tc , e ) ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "cleanupSubscription" ) ; } | Delete the subscription in question . |
38,988 | public void setRunning ( boolean running ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "setRunning" ) ; SibTr . exit ( tc , "setRunning" ) ; } _isRunning = running ; return ; } | Method setRunning - Set indicator that the asynchDeletionThread is running |
38,989 | public boolean isRunning ( ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isRunning" ) ; SibTr . exit ( tc , "isRunning" , new Boolean ( _isRunning ) ) ; } return _isRunning ; } | Method isRunning - Determine if the AsynchDeletionThread is running or not . |
38,990 | public void setStopping ( ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "setStopping" ) ; SibTr . exit ( tc , "setStopping" ) ; } _isStopping = true ; return ; } | Method setStopping - Set indicator that the asynchDeletionThread is stopping |
38,991 | public boolean isStopping ( ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isStopping" ) ; SibTr . exit ( tc , "isStopping" , new Boolean ( _isStopping ) ) ; } return _isStopping ; } | Method isStopping - Determine if the AsynchDeletionThread is stopping or not . |
38,992 | public void rerun ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rerun" ) ; _rerunRequested = true ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rerun" ) ; } | Indicate that we want the Asynch deletion thread to run again |
38,993 | public static boolean waitForPageResponse ( HtmlPage page , String responseMessage ) throws InterruptedException { int i = 0 ; boolean isTextFound = false ; while ( ! isTextFound && i < 5 ) { isTextFound = page . asText ( ) . contains ( responseMessage ) ; i ++ ; Thread . sleep ( 1000 ) ; Log . info ( c , "waitForPageResponse" , "Waiting for: " + responseMessage + " isTextFound: " + isTextFound + " i: " + i ) ; } return isTextFound ; } | Create a custom wait mechanism that waits for any background JavaScript to finish and verifies a message in the page response . |
38,994 | @ FFDCIgnore ( InvocationTargetException . class ) public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "invoke" , method . toGenericString ( ) ) ; if ( actualMessageObject instanceof JmsMessageImpl ) { if ( ( ( JmsMessageImpl ) actualMessageObject ) . isAsynSendInProgress ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Application is trying to access message object.. when asysn send is in progress.. throwing JMSException" ) ; throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "INVALID_MESSAGE_ACCESS_CWSIA0516E" , null , tc ) ; } } Object retObject = null ; try { retObject = method . invoke ( actualMessageObject , args ) ; } catch ( InvocationTargetException e ) { throw e . getCause ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "invoke" , retObject ) ; return retObject ; } | While Async send operation is in progress do not allow application to access message object |
38,995 | public static boolean hasClientBehavior ( String eventName , Map < String , List < ClientBehavior > > behaviors , FacesContext facesContext ) { if ( behaviors == null ) { return false ; } return ( behaviors . get ( eventName ) != null ) ; } | Checks if the given component has a behavior attachment with a given name . |
38,996 | public static boolean renderBehaviorizedAttribute ( FacesContext facesContext , ResponseWriter writer , String componentProperty , UIComponent component , String eventName , Collection < ClientBehaviorContext . Parameter > eventParameters , Map < String , List < ClientBehavior > > clientBehaviors , String htmlAttrName , String attributeValue ) throws IOException { return renderBehaviorizedAttribute ( facesContext , writer , componentProperty , component , component . getClientId ( facesContext ) , eventName , eventParameters , clientBehaviors , htmlAttrName , attributeValue ) ; } | Render an attribute taking into account the passed event the component property and the passed attribute value for the component property . The event will be rendered on the selected htmlAttrName . |
38,997 | public static boolean isHideNoSelectionOption ( UIComponent component ) { Object hideNoSelectionOptionAttr = component . getAttributes ( ) . get ( JSFAttr . HIDE_NO_SELECTION_OPTION_ATTR ) ; return ( ( hideNoSelectionOptionAttr instanceof String && "true" . equalsIgnoreCase ( ( String ) hideNoSelectionOptionAttr ) ) || ( hideNoSelectionOptionAttr instanceof Boolean && ( ( Boolean ) hideNoSelectionOptionAttr ) ) ) ; } | Returns the value of the hideNoSelectionOption attribute of the given UIComponent |
38,998 | public static void renderUnhandledFacesMessages ( FacesContext facesContext ) throws IOException { HtmlMessages messages = ( HtmlMessages ) facesContext . getApplication ( ) . createComponent ( HtmlMessages . COMPONENT_TYPE ) ; messages . setId ( "javax_faces_developmentstage_messages" ) ; messages . setTitle ( "Project Stage[Development]: Unhandled Messages" ) ; messages . setStyle ( "color:orange" ) ; messages . setRedisplay ( false ) ; messages . encodeAll ( facesContext ) ; } | Renders all FacesMessages which have not been rendered yet with the help of a HtmlMessages component . |
38,999 | protected void deactivate ( ComponentContext compcontext ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Deactivating " + this ) ; } INSTANCE . compareAndSet ( this , null ) ; } | DS method to deactivate this component |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.