/** * Checking all {@link Rule}s about the protected method. * * @param method the protected method * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(Method method) throws BlockException { return Env.sph.entry(method, EntryType.OUT, 1, OBJECTS0); }
/** * Checking all {@link Rule}s about the resource. * * @param name the unique name for the protected resource * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(String name, EntryType type) throws BlockException { return Env.sph.entry(name, type, 1, OBJECTS0); }
/** * Checking all {@link Rule}s about the resource. * * @param name the unique string for the resource * @param count tokens required * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(String name, int count) throws BlockException { return Env.sph.entry(name, EntryType.OUT, count, OBJECTS0); }
/** * Checking all {@link Rule}s about the resource. * * @param name the unique name for the protected resource * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @param count tokens required * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(String name, EntryType type, int count) throws BlockException { return Env.sph.entry(name, type, count, OBJECTS0); }
/** * Checking all {@link Rule}s about the protected method. * * @param method the protected method * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(Method method, EntryType type) throws BlockException { return Env.sph.entry(method, type, 1, OBJECTS0); }
/** * Checking all {@link Rule}s about the resource. * * @param name the unique name of the protected resource * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(String name) throws BlockException { return Env.sph.entry(name, EntryType.OUT, 1, OBJECTS0); }
/** * Checking all {@link Rule}s about the protected method. * * @param method the protected method * @param count tokens required * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(Method method, int count) throws BlockException { return Env.sph.entry(method, EntryType.OUT, count, OBJECTS0); }
/** * Checking all {@link Rule}s about the protected method. * * @param method the protected method * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @param count tokens required * @param args the parameters of the method. * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(Method method, EntryType type, int count, Object... args) throws BlockException { return Env.sph.entry(method, type, count, args); }
/** * Checking all {@link Rule}s about the resource. * * @param name the unique name for the protected resource * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @param count tokens required * @param args extra parameters. * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(String name, EntryType type, int count, Object... args) throws BlockException { return Env.sph.entry(name, type, count, args); }
/** * Checking all {@link Rule}s about the protected method. * * @param method the protected method * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @param count tokens required * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(Method method, EntryType type, int count) throws BlockException { return Env.sph.entry(method, type, count, OBJECTS0); }
/** * Checking all {@link Rule}s about the resource. * * @param name the unique name for the protected resource * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @param count tokens required * @param args extra parameters. * @return true if no rule's threshold is exceeded, otherwise return false. */ public static boolean entry(String name, EntryType type, int count, Object... args) { try { Env.sph.entry(name, type, count, args); } catch (BlockException e) { return false; } catch (Throwable e) { RecordLog.info("[Sentinel] Fatal error", e); return true; } return true; }
/** * Checking all {@link Rule}s about the protected method. * * @param method the protected method * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @param count tokens required * @param args the parameters of the method. * @return true if no rule's threshold is exceeded, otherwise return false. */ public static boolean entry(Method method, EntryType type, int count, Object... args) { try { Env.sph.entry(method, type, count, args); } catch (BlockException e) { return false; } catch (Throwable e) { RecordLog.info("[Sentinel] Fatal error", e); return true; } return true; }
/** * Checking all {@link Rule}s about the resource. * * @param name the unique name for the protected resource * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(String name, EntryType type) throws BlockException { return Env.sph.entry(name, type, 1, OBJECTS0); }
/** * Checking all {@link Rule}s about the resource. * * @param name the unique name of the protected resource * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(String name) throws BlockException { return Env.sph.entry(name, EntryType.OUT, 1, OBJECTS0); }
/** * Checking all {@link Rule}s about the protected method. * * @param method the protected method * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(Method method, EntryType type) throws BlockException { return Env.sph.entry(method, type, 1, OBJECTS0); }
/** * Checking all {@link Rule}s about the protected method. * * @param method the protected method * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(Method method) throws BlockException { return Env.sph.entry(method, EntryType.OUT, 1, OBJECTS0); }
/** * Checking all {@link Rule}s about the protected method. * * @param method the protected method * @param count tokens required * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(Method method, int count) throws BlockException { return Env.sph.entry(method, EntryType.OUT, count, OBJECTS0); }
/** * Checking all {@link Rule}s about the resource. * * @param name the unique string for the resource * @param count tokens required * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(String name, int count) throws BlockException { return Env.sph.entry(name, EntryType.OUT, count, OBJECTS0); }
/** * Checking all {@link Rule}s about the protected method. * * @param method the protected method * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @param count tokens required * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(Method method, EntryType type, int count) throws BlockException { return Env.sph.entry(method, type, count, OBJECTS0); }
/** * Checking all {@link Rule}s about the resource. * * @param name the unique name for the protected resource * @param type the resource is an inbound or an outbound method. This is used * to mark whether it can be blocked when the system is unstable, * only inbound traffic could be blocked by {@link SystemRule} * @param count tokens required * @throws BlockException if the block criteria is met, eg. when any rule's threshold is exceeded. */ public static Entry entry(String name, EntryType type, int count) throws BlockException { return Env.sph.entry(name, type, count, OBJECTS0); }