public abstract class Interceptor extends java.lang.Object implements IInterceptor
| Constructor and Description |
|---|
Interceptor() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Integer |
getMaxExecutionTimeSeconds() |
java.lang.Integer |
getMaxFutureThreadPoolSize() |
MeterRegistry |
getMeterRegistry() |
ReturnValue |
onGetBeanProperty(IInvoker invoker,
java.lang.Object receiver,
java.lang.String property)
Gets a Java Bean property
|
ReturnValue |
onGetInstanceField(IInvoker invoker,
java.lang.Object receiver,
java.lang.Class<?> receiverFormalType,
java.lang.String fieldName)
Get an instance field's value
|
ReturnValue |
onGetStaticField(IInvoker invoker,
java.lang.Class<?> receiver,
java.lang.String fieldName)
Get a static field's value
|
ReturnValue |
onInvokeConstructor(IInvoker invoker,
java.lang.Class<?> receiver,
java.lang.Object... args)
Invokes a constructor
|
ReturnValue |
onInvokeInstanceMethod(IInvoker invoker,
java.lang.Object receiver,
java.lang.Class<?> receiverFormalType,
java.lang.String method,
java.lang.Object... args)
Invokes an instance method
|
ReturnValue |
onInvokeStaticMethod(IInvoker invoker,
java.lang.Class<?> receiver,
java.lang.String method,
java.lang.Object... args)
Invokes a static method
|
byte[] |
onLoadClassPathResource(java.lang.String resourceName)
Loads a classpath resource
|
java.lang.String |
onReadSystemEnv(java.lang.String name)
Reads a Java environment variable
|
java.lang.String |
onReadSystemProperty(java.lang.String propertyName)
Reads a Java system property
|
void |
onSetBeanProperty(IInvoker invoker,
java.lang.Object receiver,
java.lang.String property,
java.lang.Object value)
Sets a Java Bean property
|
void |
validateLoadModule(java.lang.String moduleName)
Validates the load of a module
|
void |
validateMaxExecutionTime()
Validates the execution time
|
void |
validateVeniceFunction(java.lang.String funcName)
Validates the invocation of a Venice function.
|
public ReturnValue onInvokeInstanceMethod(IInvoker invoker, java.lang.Object receiver, java.lang.Class<?> receiverFormalType, java.lang.String method, java.lang.Object... args) throws java.lang.SecurityException
IInterceptoronInvokeInstanceMethod in interface IInterceptorinvoker - the invokerreceiver - an objectreceiverFormalType - the formal type of the receiver (e.g a superclass)method - a methodargs - a list of argumentsjava.lang.SecurityException - if the instance method is not whitelistedpublic ReturnValue onInvokeStaticMethod(IInvoker invoker, java.lang.Class<?> receiver, java.lang.String method, java.lang.Object... args) throws java.lang.SecurityException
IInterceptoronInvokeStaticMethod in interface IInterceptorinvoker - the invokerreceiver - a classmethod - a methodargs - a list of argumentsjava.lang.SecurityException - if the static method is not whitelistedpublic ReturnValue onInvokeConstructor(IInvoker invoker, java.lang.Class<?> receiver, java.lang.Object... args) throws java.lang.SecurityException
IInterceptoronInvokeConstructor in interface IInterceptorinvoker - the invokerreceiver - a classargs - a list of argumentsjava.lang.SecurityException - if the constructor is not whitelistedpublic ReturnValue onGetBeanProperty(IInvoker invoker, java.lang.Object receiver, java.lang.String property) throws java.lang.SecurityException
IInterceptoronGetBeanProperty in interface IInterceptorinvoker - the invokerreceiver - an objectproperty - a property namejava.lang.SecurityException - if the bean property (instance method) is not whitelistedpublic void onSetBeanProperty(IInvoker invoker, java.lang.Object receiver, java.lang.String property, java.lang.Object value) throws java.lang.SecurityException
IInterceptoronSetBeanProperty in interface IInterceptorinvoker - the invokerreceiver - an objectproperty - a property namevalue - a property valuejava.lang.SecurityException - if the bean property (instance method) is not whitelistedpublic ReturnValue onGetStaticField(IInvoker invoker, java.lang.Class<?> receiver, java.lang.String fieldName) throws java.lang.SecurityException
IInterceptoronGetStaticField in interface IInterceptorinvoker - the invokerreceiver - a classfieldName - a field namejava.lang.SecurityException - if the static field is not whitelistedpublic ReturnValue onGetInstanceField(IInvoker invoker, java.lang.Object receiver, java.lang.Class<?> receiverFormalType, java.lang.String fieldName) throws java.lang.SecurityException
IInterceptoronGetInstanceField in interface IInterceptorinvoker - the invokerreceiver - an objectreceiverFormalType - the formal type of the receiver (e.g a superclass)fieldName - a field namejava.lang.SecurityException - if the instance field is not whitelistedpublic byte[] onLoadClassPathResource(java.lang.String resourceName)
throws java.lang.SecurityException
IInterceptoronLoadClassPathResource in interface IInterceptorresourceName - a resource name (e.g.: /foo/org/image.png)java.lang.SecurityException - if the classpath resource is not whitelistedpublic java.lang.String onReadSystemProperty(java.lang.String propertyName)
throws java.lang.SecurityException
IInterceptoronReadSystemProperty in interface IInterceptorpropertyName - a property name (e.g: user.home)java.lang.SecurityException - if the property is not whitelistedpublic java.lang.String onReadSystemEnv(java.lang.String name)
throws java.lang.SecurityException
IInterceptoronReadSystemEnv in interface IInterceptorname - a variable name (e.g: USER)java.lang.SecurityException - if the variable is not whitelistedpublic void validateVeniceFunction(java.lang.String funcName)
throws java.lang.SecurityException
IInterceptorvalidateVeniceFunction in interface IInterceptorfuncName - A venice function namejava.lang.SecurityException - if the function is blacklisted and not allowed to be invoked.public void validateLoadModule(java.lang.String moduleName)
throws java.lang.SecurityException
IInterceptorvalidateLoadModule in interface IInterceptormoduleName - the module namejava.lang.SecurityException - if the module is blacklistedpublic void validateMaxExecutionTime()
throws java.lang.SecurityException
IInterceptorvalidateMaxExecutionTime in interface IInterceptorjava.lang.SecurityException - if the execution time exceeds the configured limit.public java.lang.Integer getMaxExecutionTimeSeconds()
getMaxExecutionTimeSeconds in interface IInterceptorSandbox is allowed to run.public java.lang.Integer getMaxFutureThreadPoolSize()
getMaxFutureThreadPoolSize in interface IInterceptorSandbox is allowed to use.public MeterRegistry getMeterRegistry()
getMeterRegistry in interface IInterceptor