コード例 #1
0
 public void tryDestroyingSharedState()
 {
     if (sharedSearchContext.getContextInfo().amountOfThreads() == 0)
     {
         sharedSearchContext = null;
     }
 }
コード例 #2
0
        public SearchContext(ConfiguredSettings configs, ConcurrentQueue <string> mainQueue, ConcurrentQueue <string> secondaryQueue, string id) : base(mainQueue, secondaryQueue)
        {
            contextualId       = id;
            configuredSettings = configs;

            bool isUsingQueue = configs.get(ConfiguredConstants.USE_QUEUE_LBL).ToBoolean();

            if (sharedSearchContext == null)
            {
                sharedSearchContext = new SharedSearchContextState(isUsingQueue);
                sharedSearchContext.getContextInfo().addThreadId(contextualId);
            }
            else
            {
                sharedSearchContext.getContextInfo().addThreadId(contextualId);
            }
            maxPageSearchLimit = StringExtensionMethods.ToInteger(configs.get(ConfiguredConstants.SEARCH_LIMIT_LBL));
            traversalStyle     = TraversalStyle.getTraversalType(configs.get(ConfiguredConstants.TRAVERSAL_STYLE_LBL));
            currentUrl         = StringExtensionMethods.URLifyParseAddition(configs.get(ConfiguredConstants.ENTRY_POINT_LBL), configs.get(ConfiguredConstants.SEARCH_PHRASE_LBL));
        }