public boolean filter(Object obj) { return obj==arg ? true : DecouplingInterceptor.this.filter.filter(obj); } } : this.filter;
public boolean filter(Object obj) { return obj==value ? false : deffilter.filter(obj); } } : deffilter;
public boolean filter(Object obj) { return obj==arg ? true : DecouplingInterceptor.this.filter.filter(obj); } } : this.filter;
/** * Test if the processor is applicable. * @param object The object. * @param targetcl If not null, the traverser should make sure that the result object is compatible with the class loader, * e.g. by cloning the object using the class loaded from the target class loader. * @return True, if is applicable. */ public boolean isApplicable(Object object, Type type, boolean clone, ClassLoader targetcl) { return filter.filter(object); // && !clone // does not work because also in clone mode some immutable objects should not be cloned }
public boolean filter(Object obj) { return obj==value ? false : deffilter.filter(obj); } } : deffilter;
/** * Test if an object passes the filter. * @return True, if passes the filter. */ public boolean filter(Object obj) { boolean ret = false; for(int i=0; !ret && i<filters.length; i++) { if(filters[i]!=null) { try { ret = filters[i].filter(obj); } catch(Exception e) { // just catch. } } } return ret; }
public boolean filter(Object obj) { return (((ISpaceObject) obj).getType().equals(type) && filter.filter(obj)); } });
public boolean filter(Object obj) { boolean ret = false; if (obj instanceof VInParameter || obj instanceof VOutParameter) { ret = basefilter.filter(((mxICell) obj).getParent()); } return ret; } };
/** * Perform a call on given service with given arguments. */ public Object performCall(IService service, Object[] args) throws Exception { if(service==null) throw new IllegalArgumentException("Service must not be null."); if(filter.filter(new Tuple2<IService, Object[]>(service, args))) { return method.invoke(service, args); } else { throw new RuntimeException("Filter prohibted call."); } }
/** * Perform a call on given service with given arguments. */ public Object performCall(IService service, Object[] args) throws Exception { if(service==null) throw new IllegalArgumentException("Service must not be null."); if(filter.filter(new Tuple2<IService, Object[]>(service, args))) { return method.invoke(service, args); } else { throw new RuntimeException("Filter prohibted call."); } }
/** * Send a backward command in direction of the source. * @param info The command info. */ public void sendBackwardCommand(Object info) { if(bcommands!=null) { for(Map.Entry<ICommand<Object>, IFilter<Object>> entry: bcommands.entrySet()) { IFilter<Object> fil = entry.getValue(); if(fil==null || fil.filter(info)) { ICommand<Object> com = entry.getKey(); com.execute(info); } } } }
/** * Send a backward command in direction of the source. * @param info The command info. */ public void sendBackwardCommand(Object info) { if(bcommands!=null) { for(Map.Entry<ICommand<Object>, IFilter<Object>> entry: bcommands.entrySet()) { IFilter<Object> fil = entry.getValue(); if(fil==null || fil.filter(info)) { ICommand<Object> com = entry.getKey(); com.execute(info); } } } }
/** * Forward event to one subscribers. */ protected void forwardEvent(IMonitoringEvent event, SubscriptionIntermediateFuture<IMonitoringEvent> sub) { IFilter<IMonitoringEvent> fil = subscriptions.get(sub); try { if(fil==null || fil.filter(event)) { // System.out.println("forward to: "+sub); if(!sub.addIntermediateResultIfUndone(event)) { subscriptions.remove(sub); } } } catch(Exception e) { // catch filter exceptions e.printStackTrace(); } } }
/** * Get the pre-processor. * @return The pre-processor */ public synchronized IPreProcessor[] getPreProcessors(Object object, Object typeinfo) { List<IPreProcessor> ret = new ArrayList<IPreProcessor>(); IPreProcessor tiproc = typeinfo instanceof TypeInfo? ((TypeInfo)typeinfo).getPreProcessor(): null; if(tiproc!=null) ret.add(tiproc); if(preprocessors!=null) { for(Iterator<IFilter> it = preprocessors.keySet().iterator(); it.hasNext(); ) { IFilter fil = it.next(); if(fil.filter(object)) { ret.add(preprocessors.get(fil)); } } } return ret.toArray(new IPreProcessor[ret.size()]); }
/** * Get the post-processor. * @return The post-processor */ public synchronized IPostProcessor[] getPostProcessors(Object object, Object typeinfo) { List<IPostProcessor> ret = new ArrayList<IPostProcessor>(); IPostProcessor tiproc = typeinfo instanceof TypeInfo? ((TypeInfo)typeinfo).getPostProcessor(): null; if(tiproc!=null) ret.add(tiproc); if(postprocessors!=null) { for(Iterator<IFilter> it = postprocessors.keySet().iterator(); it.hasNext(); ) { IFilter fil = it.next(); if(fil.filter(object)) { ret.add(postprocessors.get(fil)); } } } return ret.toArray(new IPostProcessor[ret.size()]); }
/** * Forward event to one subscribers. */ protected void forwardEvent(IMonitoringEvent event, SubscriptionIntermediateFuture<IMonitoringEvent> sub) { IFilter<IMonitoringEvent> fil = subscriptions.get(sub); try { if(fil==null || fil.filter(event)) { // System.out.println("forward to: "+sub); if(!sub.addIntermediateResultIfUndone(event)) { subscriptions.remove(sub); } } } catch(Exception e) { // catch filter exceptions e.printStackTrace(); } } }
try if(filter==null || filter.filter(entry))
public boolean filter(Object obj) { boolean ret = false; if (obj instanceof VActivity) { ret = ((VActivity) obj).getMActivity().isEventHandler() && basefilter.filter(obj); } return ret; } };
public void intermediateResultAvailable(String file) { try { String clname = file.substring(0, file.length()-6).replace('/', '.'); // System.out.println("Found candidate: "+clname+" "+cnt[0]); if(newcl[0]==null || cnt[0]++%500==0) newcl[0] = new URLClassLoader(urls, null); // Class<?> tmpcl = Class.forName(clname, false, newcl[0]); if(tmpcl!=null && classfilter.filter(tmpcl)) { if((max>0 && ++resultcnt>max) || !ret.addIntermediateResultIfUndone(tmpcl)) { // System.out.println("term: "+resultcnt); fut.terminate(); } // ret.addIntermediateResult(SReflect.findClass0(clname, null, classloader)); } } catch(Throwable t) { // t.printStackTrace(); // System.out.println(file); } }