Package org.hibernate.search.filter

Examples of org.hibernate.search.filter.FilterKey


      return instance;
   }


   private FilterKey createFilterKey(FilterDef def, Object instance) {
      FilterKey key = null;
      if (!cacheInstance(def.getCacheMode())) {
         return key; // if the filter is not cached there is no key!
      }

      if (def.getKeyMethod() == null) {
         key = new FilterKey() {
            public int hashCode() {
               return getImpl().hashCode();
            }

            public boolean equals(Object obj) {
               if (!(obj instanceof FilterKey)) {
                  return false;
               }
               FilterKey that = (FilterKey) obj;
               return this.getImpl().equals(that.getImpl());
            }
         };
      } else {
         try {
            key = (FilterKey) def.getKeyMethod().invoke(instance);
View Full Code Here


      * FilterKey implementations and Filter(Factory) do not have to be threadsafe wrt their parameter injection
      * as FilterCachingStrategy ensure a memory barrier between concurrent thread calls
      */
      FilterDef def = searchFactory.getFilterDefinition(fullTextFilter.getName());
      Object instance = createFilterInstance(fullTextFilter, def);
      FilterKey key = createFilterKey(def, instance);

      // try to get the filter out of the cache
      Filter filter = cacheInstance(def.getCacheMode()) ?
            searchFactory.getFilterCachingStrategy().getCachedFilter(key) :
            null;
View Full Code Here

      return instance;
   }


   private FilterKey createFilterKey(FilterDef def, Object instance) {
      FilterKey key = null;
      if (!cacheInstance(def.getCacheMode())) {
         return key; // if the filter is not cached there is no key!
      }

      if (def.getKeyMethod() == null) {
         key = new FilterKey() {
            public int hashCode() {
               return getImpl().hashCode();
            }

            public boolean equals(Object obj) {
               if (!(obj instanceof FilterKey)) {
                  return false;
               }
               FilterKey that = (FilterKey) obj;
               return this.getImpl().equals(that.getImpl());
            }
         };
      } else {
         try {
            key = (FilterKey) def.getKeyMethod().invoke(instance);
View Full Code Here

    if ( isPreQueryFilterOnly( def ) ) {
      return null;
    }

    Object instance = createFilterInstance( fullTextFilter, def );
    FilterKey key = createFilterKey( def, instance );

    // try to get the filter out of the cache
    Filter filter = cacheInstance( def.getCacheMode() ) ?
        searchFactoryImplementor.getFilterCachingStrategy().getCachedFilter( key ) :
        null;
View Full Code Here

    return filter;
  }

  private FilterKey createFilterKey(FilterDef def, Object instance) {
    FilterKey key = null;
    if ( !cacheInstance( def.getCacheMode() ) ) {
      return key; // if the filter is not cached there is no key!
    }

    if ( def.getKeyMethod() == null ) {
      key = new FilterKey() {
        public int hashCode() {
          return getImpl().hashCode();
        }

        public boolean equals(Object obj) {
          if ( !( obj instanceof FilterKey ) ) {
            return false;
          }
          FilterKey that = (FilterKey) obj;
          return this.getImpl().equals( that.getImpl() );
        }
      };
    }
    else {
      try {
View Full Code Here

    return filter;
  }

  private FilterKey createFilterKey(FilterDef def, Object instance) {
    FilterKey key = null;
    if ( !cacheInstance( def.getCacheMode() ) ) {
      return key; // if the filter is not cached there is no key!
    }

    if ( def.getKeyMethod() == null ) {
      key = new FilterKey() {
        public int hashCode() {
          return getImpl().hashCode();
        }

        public boolean equals(Object obj) {
          if ( !( obj instanceof FilterKey ) ) {
            return false;
          }
          FilterKey that = ( FilterKey ) obj;
          return this.getImpl().equals( that.getImpl() );
        }
      };
    }
    else {
      try {
View Full Code Here

    if ( isPreQueryFilterOnly( def ) ) {
      return null;
    }

    Object instance = createFilterInstance( fullTextFilter, def );
    FilterKey key = createFilterKey( def, instance );

    // try to get the filter out of the cache
    Filter filter = cacheInstance( def.getCacheMode() ) ?
        searchFactoryImplementor.getFilterCachingStrategy().getCachedFilter( key ) :
        null;
View Full Code Here

    if ( isPreQueryFilterOnly( def ) ) {
      return null;
    }

    Object instance = createFilterInstance( fullTextFilter, def );
    FilterKey key = createFilterKey( def, instance );

    // try to get the filter out of the cache
    Filter filter = cacheInstance( def.getCacheMode() ) ?
        searchFactoryImplementor.getFilterCachingStrategy().getCachedFilter( key ) :
        null;
View Full Code Here

    return filter;
  }

  private FilterKey createFilterKey(FilterDef def, Object instance) {
    FilterKey key = null;
    if ( !cacheInstance( def.getCacheMode() ) ) {
      return key; // if the filter is not cached there is no key!
    }

    if ( def.getKeyMethod() == null ) {
      key = new FilterKey() {
        @Override
        public int hashCode() {
          return getImpl().hashCode();
        }

        @Override
        public boolean equals(Object obj) {
          if ( !( obj instanceof FilterKey ) ) {
            return false;
          }
          FilterKey that = (FilterKey) obj;
          return this.getImpl().equals( that.getImpl() );
        }
      };
    }
    else {
      try {
View Full Code Here

    if ( isPreQueryFilterOnly( def ) ) {
      return null;
    }

    Object instance = createFilterInstance( fullTextFilter, def );
    FilterKey key = createFilterKey( def, instance );

    // try to get the filter out of the cache
    Filter filter = cacheInstance( def.getCacheMode() ) ?
        searchFactoryImplementor.getFilterCachingStrategy().getCachedFilter( key ) :
        null;
View Full Code Here

TOP

Related Classes of org.hibernate.search.filter.FilterKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.