Examples of ObjectFilter


Examples of org.infinispan.objectfilter.ObjectFilter

      QueryFactory qf = matcher.getQueryFactory();
      Query q = qf.from(Person.class)
            .having("name").eq("John").toBuilder().build();

      ObjectFilter objectFilter = matcher.getObjectFilter(q);

      matcher.match(person);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertTrue(result.getInstance() == person);
   }
View Full Code Here

Examples of org.infinispan.objectfilter.ObjectFilter

         public void onFilterResult(Object instance, Object[] projection, Comparable[] sortProjection) {
            matchCount[0]++;
         }
      });

      ObjectFilter objectFilter = matcher.getObjectFilter(filterSubscription);

      matcher.match(person);
      assertEquals(1, matchCount[0]);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertTrue(result.getInstance() == person);

      assertEquals(1, matchCount[0]); // check that the object filter did not also mistakenly trigger a match in the parent matcher
   }
View Full Code Here

Examples of org.infinispan.objectfilter.ObjectFilter

      String queryString = "from org.infinispan.objectfilter.test.model.Person p where p.name = 'John'";

      Matcher matcher = createMatcher();
      Object person = createPerson1();

      ObjectFilter objectFilter = matcher.getObjectFilter(queryString);

      matcher.match(person);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertTrue(result.getInstance() == person);
   }
View Full Code Here

Examples of org.infinispan.objectfilter.ObjectFilter

      QueryFactory qf = matcher.getQueryFactory();
      Query q = qf.from(Person.class)
            .having("name").eq("John").toBuilder().build();

      ObjectFilter objectFilter = matcher.getObjectFilter(q);

      matcher.match(person);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertTrue(result.getInstance() == person);
   }
View Full Code Here

Examples of org.infinispan.objectfilter.ObjectFilter

   public ObjectFilter getObjectFilter() {
      if (objectFilter == null) {
         if (queryCache != null) {
            KeyValuePair<String, Class> queryCacheKey = new KeyValuePair<String, Class>(jpaQuery, matcherImplClass);
            ObjectFilter of = queryCache.get(queryCacheKey);
            if (of == null) {
               of = matcher.getObjectFilter(jpaQuery);
               queryCache.put(queryCacheKey, of);
            }
            objectFilter = of;
View Full Code Here

Examples of org.jnode.vm.facade.ObjectFilter

    @Override
    public void execute() throws Exception {
        PrintWriter out = getOutput().getPrintWriter();
        out.println(STR_ON_HEAP);
       
        ObjectFilter filter = null;
        if (className.isSet()) {
            SimpleObjectFilter f = new SimpleObjectFilter();
            f.setClassName(className.getValues());
            filter = f;
        }
View Full Code Here

Examples of org.kie.api.runtime.ObjectFilter

            throw new UnsupportedOperationException( " IsA Operator : Unsupported literal " + value );
        }


        protected TraitableBean lookForWrapper( final Object objectValue, InternalWorkingMemory workingMemory) {
            Iterator iter = workingMemory.getObjectStore().iterateObjects( new ObjectFilter() {
                public boolean accept(Object object) {
                    if ( object instanceof TraitProxy ) {
                        Object core = ((TraitProxy) object).getObject();
                        if ( core instanceof CoreWrapper ) {
                            core = ((CoreWrapper) core).getCore();
View Full Code Here

Examples of org.kie.api.runtime.ObjectFilter

        assertEquals( 1, kSession.getObjects().size() );
        kSession.dispose();
    }

    private Collection getModelMarker( final KieSession kSession, final String modelName ) {
        return kSession.getObjects( new ObjectFilter() {
            public boolean accept( Object o ) {
                return o instanceof ModelMarker && modelName.equals( ((ModelMarker) o).getModelName() );
            }
        } );
    }
View Full Code Here

Examples of org.kie.api.runtime.ObjectFilter

        checkGeneratedRules();
    }

    private Collection getModelMarker( final KieSession kSession, final String modelName ) {
        return kSession.getObjects( new ObjectFilter() {
            public boolean accept( Object o ) {
                return o instanceof ModelMarker && modelName.equals( ((ModelMarker) o).getModelName() );
            }
        } );
    }
View Full Code Here

Examples of org.kie.api.runtime.ObjectFilter

            throw new UnsupportedOperationException( " IsA Operator : Unsupported literal " + value );
        }


        protected TraitableBean lookForWrapper( final Object objectValue, InternalWorkingMemory workingMemory) {
            Iterator iter = workingMemory.getObjectStore().iterateObjects( new ObjectFilter() {
                public boolean accept(Object object) {
                    if ( object instanceof TraitProxy ) {
                        Object core = ((TraitProxy) object).getObject();
                        if ( core instanceof CoreWrapper ) {
                            core = ((CoreWrapper) core).getCore();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.