public static void main(String[] args) { TideComponentNameMatcher matcher = new TideComponentNameMatcher(".*Service", false); System.out.println(matcher.matches("helloService", null, null, false)); } }
public TideComponentMatcher getInstanceOfMatcher(String type, boolean disabled) throws GraniteConfigException { try { return new TideComponentInstanceOfMatcher(type, disabled); } catch (Exception e) { throw new GraniteConfigException("Could not instantiate Tide component matcher for instance of: " + type, e); } }
public TideComponentMatcher getAnnotatedWithMatcher(String type, boolean disabled) throws GraniteConfigException { try { return new TideComponentAnnotatedWithMatcher(type, disabled); } catch (Exception e) { throw new GraniteConfigException("Could not instantiate Tide component matcher for annotated with: " + type, e); } }
graniteConfig.getTideComponentMatchers().add(new TideComponentInstanceOfMatcher(ti.getName(), false)); log.debug("Enabled components implementing %s for Tide remoting", ti); graniteConfig.getTideComponentMatchers().add(new TideComponentAnnotatedWithMatcher(ta.getName(), false)); log.debug("Enabled components annotated with %s for Tide remoting", ta); graniteConfig.getTideComponentMatchers().add(new TideComponentNameMatcher(tn, false)); log.debug("Enabled components with name %s for Tide remoting", tn); graniteConfig.getTideComponentMatchers().add(new TideComponentTypeMatcher(tt, false)); log.debug("Enabled components with type %s for Tide remoting", tt);
public static boolean isComponentTideEnabled( Map<String, Object[]> tideComponentsByName, List<TideComponentMatcher> tideComponentMatchers, String componentName, Set<Class<?>> componentClasses, Object componentInstance) throws GraniteConfigException { String key = componentName != null ? componentName : componentClasses.toString(); if (tideComponentsByName.containsKey(key)) { if ((Integer)tideComponentsByName.get(key)[1] == componentClasses.hashCode()) return (Boolean)tideComponentsByName.get(key)[0]; } boolean enabled = false; for (TideComponentMatcher matcher : tideComponentMatchers) { if (matcher.matches(componentName, componentClasses, componentInstance, false)) { enabled = true; break; } } tideComponentsByName.put(key, new Object[] { enabled, componentClasses.hashCode()}); return enabled; }
public TideComponentMatcher getTypeMatcher(String type, boolean disabled) throws GraniteConfigException { try { return new TideComponentTypeMatcher(type, disabled); } catch (Exception e) { throw new GraniteConfigException("Could not instantiate Tide component matcher for type: " + type, e); } }
public TideComponentMatcher getNameMatcher(String name, boolean disabled) throws GraniteConfigException { try { return new TideComponentNameMatcher(name, disabled); } catch (Exception e) { throw new GraniteConfigException("Could not instantiate Tide component matcher for name: " + name, e); } }
public static void main(String[] args) { TideComponentNameMatcher matcher = new TideComponentNameMatcher(".*Service", false); System.out.println(matcher.matches("helloService", null, null, false)); } }
public static boolean isComponentTideEnabled( Map<String, Object[]> tideComponentsByName, List<TideComponentMatcher> tideComponentMatchers, String componentName, Set<Class<?>> componentClasses, Object componentInstance) throws GraniteConfigException { String key = componentName != null ? componentName : componentClasses.toString(); if (tideComponentsByName.containsKey(key)) { if ((Integer)tideComponentsByName.get(key)[1] == componentClasses.hashCode()) return (Boolean)tideComponentsByName.get(key)[0]; } boolean enabled = false; for (TideComponentMatcher matcher : tideComponentMatchers) { if (matcher.matches(componentName, componentClasses, componentInstance, false)) { enabled = true; break; } } tideComponentsByName.put(key, new Object[] { enabled, componentClasses.hashCode()}); return enabled; }
public TideComponentMatcher getInstanceOfMatcher(String type, boolean disabled) throws GraniteConfigException { try { return new TideComponentInstanceOfMatcher(type, disabled); } catch (Exception e) { throw new GraniteConfigException("Could not instantiate Tide component matcher for instance of: " + type, e); } }
public TideComponentMatcher getAnnotatedWithMatcher(String type, boolean disabled) throws GraniteConfigException { try { return new TideComponentAnnotatedWithMatcher(type, disabled); } catch (Exception e) { throw new GraniteConfigException("Could not instantiate Tide component matcher for annotated with: " + type, e); } }
public TideComponentMatcher getTypeMatcher(String type, boolean disabled) throws GraniteConfigException { try { return new TideComponentTypeMatcher(type, disabled); } catch (Exception e) { throw new GraniteConfigException("Could not instantiate Tide component matcher for type: " + type, e); } }
public TideComponentMatcher getNameMatcher(String name, boolean disabled) throws GraniteConfigException { try { return new TideComponentNameMatcher(name, disabled); } catch (Exception e) { throw new GraniteConfigException("Could not instantiate Tide component matcher for name: " + name, e); } }
public static boolean isComponentTideDisabled( Map<String, Object[]> tideComponentsByName, List<TideComponentMatcher> tideComponentMatchers, String componentName, Set<Class<?>> componentClasses, Object componentInstance) throws GraniteConfigException { String key = componentName != null ? componentName : componentClasses.toString(); if (tideComponentsByName.containsKey(key)) { if ((Integer)tideComponentsByName.get(key)[1] == componentClasses.hashCode()) return (Boolean)tideComponentsByName.get(key)[0]; } boolean disabled = false; for (TideComponentMatcher matcher : tideComponentMatchers) { if (matcher.matches(componentName, componentClasses, componentInstance, true)) { disabled = true; break; } } tideComponentsByName.put(key, new Object[] { disabled, componentClasses.hashCode()}); return disabled; } }
public static boolean isComponentTideDisabled( Map<String, Object[]> tideComponentsByName, List<TideComponentMatcher> tideComponentMatchers, String componentName, Set<Class<?>> componentClasses, Object componentInstance) throws GraniteConfigException { String key = componentName != null ? componentName : componentClasses.toString(); if (tideComponentsByName.containsKey(key)) { if ((Integer)tideComponentsByName.get(key)[1] == componentClasses.hashCode()) return (Boolean)tideComponentsByName.get(key)[0]; } boolean disabled = false; for (TideComponentMatcher matcher : tideComponentMatchers) { if (matcher.matches(componentName, componentClasses, componentInstance, true)) { disabled = true; break; } } tideComponentsByName.put(key, new Object[] { disabled, componentClasses.hashCode()}); return disabled; } }