Skip to content

Commit

Permalink
add javadoc and prepend license header
Browse files Browse the repository at this point in the history
  • Loading branch information
luffy0223 committed Apr 23, 2024
1 parent 789e74a commit 3fb3244
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@
*/
String defaultFallback() default "";


/**
* The {@code globalFallback} is used as the global fallback handler class.
* The returned class should implement the {@link IGlobalFallback} interface.
* If no specific global fallback handler is provided, the default {@link DefaultGlobalFallback} class will be used.
* @return The class that serves as the global fallback handler.
*/
Class<? extends IGlobalFallback> globalFallback() default DefaultGlobalFallback.class;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.csp.sentinel.fallback;

import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.csp.sentinel.fallback;

import java.lang.reflect.Method;
Expand All @@ -9,7 +24,14 @@
*/
public interface IGlobalFallback {


/**
*
* @param originalMethod the original method called
* @param args The parameters of the method that was originally called
* @param t The exception thrown by the method originally called
* @return The result of the global fallback handler execution
* @throws Throwable
*/
Object handle(Method originalMethod, Object[] args, Throwable t) throws Throwable;

}

0 comments on commit 3fb3244

Please sign in to comment.