public synchronized void addTarget ( Conjunction conjunction , MatchTarget object ) throws MatchingException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "addTarget" , new Object [ ] { conjunction , object } ) ; // Deal with Conjunctions that test equality on rootId when cacheing is enabled if ( rootId != null ) { // Cacheing is enabled. OrdinalPosition rootOrd = new OrdinalPosition ( 0 , 0 ) ; SimpleTest test = Factory . findTest ( rootOrd , conjunction ) ; if ( test != null && test . getKind ( ) == SimpleTest . EQ ) { // This is an equality test, so it goes in the cache only. CacheEntry e = getCacheEntry ( test . getValue ( ) , true ) ; e . exactGeneration ++ ; // even-odd transition: show we are changing it ContentMatcher exact = e . exactMatcher ; e . exactMatcher = exact = Factory . createMatcher ( rootOrd , conjunction , exact ) ; e . cachedResults = null ; try { exact . put ( conjunction , object , subExpr ) ; e . noResultCache |= exact . hasTests ( ) ; } catch ( RuntimeException exc ) { // No FFDC Code Needed. // FFDC driven by wrapper class. FFDC . processException ( this , cclass , "com.ibm.ws.sib.matchspace.impl.MatchSpaceImpl.addTarget" , exc , "1:303:1.44" ) ; //TODO: tc.exception(tc, exc); if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "addTarget" , e ) ; throw new MatchingException ( exc ) ; } finally { e . exactGeneration ++ ; // odd-even transition: show change is complete } exactPuts ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "addTarget" ) ; return ; } } // Either cacheing is not enabled or this isn't an equality test on rootId. matchTreeGeneration ++ ; // even-odd transition: show we are changing it try { matchTree . put ( conjunction , object , subExpr ) ; } catch ( RuntimeException e ) { // No FFDC Code Needed. // FFDC driven by wrapper class. FFDC . processException ( this , cclass , "com.ibm.ws.sib.matchspace.impl.MatchSpaceImpl.addTarget" , e , "1:333:1.44" ) ; //TODO: tc.exception(tc, e); if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "addTarget" , e ) ; throw new MatchingException ( e ) ; } finally { matchTreeGeneration ++ ; /* odd-even transition: show change is complete. Also invalidates non-equality information in the cache */ } wildPuts ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "addTarget" ) ; }
Adds a Conjunction to the space and associates a MatchTarget with it .