class SentinelSofaRpcProviderFilter extends AbstractSofaRpcFilter {

    @Override
    public SofaResponse invoke(FilterInvoker invoker, SofaRequest request) throws SofaRpcException {
        // Now only support sync invoke.
        if (request.getInvokeType() != null && !RpcConstants.INVOKER_TYPE_SYNC.equals(request.getInvokeType())) {
            return invoker.invoke(request);
        }

        String callerApp = getApplicationName(request);
        String interfaceResourceName = getInterfaceResourceName(request);
        String methodResourceName = getMethodResourceName(request);

        Entry interfaceEntry = null;
        Entry methodEntry = null;
        try {
            ContextUtil.enter(methodResourceName, callerApp);

            interfaceEntry = SphU.entry(interfaceResourceName, ResourceTypeConstants.COMMON_RPC, EntryType.IN);
            methodEntry = SphU.entry(methodResourceName, ResourceTypeConstants.COMMON_RPC,
                EntryType.IN, getMethodArguments(request));

            SofaResponse response = invoker.invoke(request);

            traceResponseException(response, interfaceEntry, methodEntry);
            return response;
        } catch (BlockException e) {
            return SofaRpcFallbackRegistry.getProviderFallback().handle(invoker, request, e);
        } catch (Throwable t) {
            throw traceOtherException(t, interfaceEntry, methodEntry);
        } finally {
            if (methodEntry != null) {
                methodEntry.exit(1, getMethodArguments(request));
            }
            if (interfaceEntry != null) {
                interfaceEntry.exit();
            }
            ContextUtil.exit();
        }
    }

}