-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize: add saga io.seata compatible api (#6312)
- Loading branch information
Showing
20 changed files
with
2,613 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
compatible/src/main/java/io/seata/saga/engine/AsyncCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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 io.seata.saga.engine; | ||
|
||
import io.seata.saga.proctrl.ProcessContext; | ||
import io.seata.saga.statelang.domain.StateMachineInstance; | ||
|
||
/** | ||
* Async Callback | ||
* | ||
*/ | ||
public interface AsyncCallback { | ||
|
||
/** | ||
* on finished | ||
* | ||
* @param context | ||
* @param stateMachineInstance | ||
*/ | ||
void onFinished(ProcessContext context, StateMachineInstance stateMachineInstance); | ||
|
||
/** | ||
* on error | ||
* | ||
* @param context | ||
* @param stateMachineInstance | ||
* @param exp | ||
*/ | ||
void onError(ProcessContext context, StateMachineInstance stateMachineInstance, Exception exp); | ||
} |
170 changes: 170 additions & 0 deletions
170
compatible/src/main/java/io/seata/saga/engine/StateMachineConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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 io.seata.saga.engine; | ||
|
||
import org.apache.seata.saga.engine.expression.ExpressionFactoryManager; | ||
import org.apache.seata.saga.engine.expression.ExpressionResolver; | ||
import org.apache.seata.saga.engine.invoker.ServiceInvokerManager; | ||
import org.apache.seata.saga.engine.repo.StateLogRepository; | ||
import org.apache.seata.saga.engine.repo.StateMachineRepository; | ||
import org.apache.seata.saga.engine.sequence.SeqGenerator; | ||
import org.apache.seata.saga.engine.store.StateLangStore; | ||
import org.apache.seata.saga.engine.store.StateLogStore; | ||
import org.apache.seata.saga.engine.strategy.StatusDecisionStrategy; | ||
import org.apache.seata.saga.proctrl.eventing.impl.ProcessCtrlEventPublisher; | ||
import org.springframework.context.ApplicationContext; | ||
|
||
import javax.script.ScriptEngineManager; | ||
import java.util.concurrent.ThreadPoolExecutor; | ||
|
||
/** | ||
* StateMachineConfig | ||
* | ||
*/ | ||
public interface StateMachineConfig { | ||
|
||
/** | ||
* Gets state log store. | ||
* | ||
* @return the StateLogRepository | ||
*/ | ||
StateLogRepository getStateLogRepository(); | ||
|
||
/** | ||
* Gets get state log store. | ||
* | ||
* @return the get StateLogStore | ||
*/ | ||
StateLogStore getStateLogStore(); | ||
|
||
/** | ||
* Gets get state language definition store. | ||
* | ||
* @return the get StateLangStore | ||
*/ | ||
StateLangStore getStateLangStore(); | ||
|
||
/** | ||
* Gets get expression factory manager. | ||
* | ||
* @return the get expression factory manager | ||
*/ | ||
ExpressionFactoryManager getExpressionFactoryManager(); | ||
|
||
/** | ||
* Gets get expression resolver | ||
* | ||
* @return the get expression resolver | ||
*/ | ||
ExpressionResolver getExpressionResolver(); | ||
|
||
/** | ||
* Gets get charset. | ||
* | ||
* @return the get charset | ||
*/ | ||
String getCharset(); | ||
|
||
/** | ||
* Gets get default tenant id. | ||
* | ||
* @return the default tenant id | ||
*/ | ||
String getDefaultTenantId(); | ||
|
||
/** | ||
* Gets get state machine repository. | ||
* | ||
* @return the get state machine repository | ||
*/ | ||
StateMachineRepository getStateMachineRepository(); | ||
|
||
/** | ||
* Gets get status decision strategy. | ||
* | ||
* @return the get status decision strategy | ||
*/ | ||
StatusDecisionStrategy getStatusDecisionStrategy(); | ||
|
||
/** | ||
* Gets get seq generator. | ||
* | ||
* @return the get seq generator | ||
*/ | ||
SeqGenerator getSeqGenerator(); | ||
|
||
/** | ||
* Gets get process ctrl event publisher. | ||
* | ||
* @return the get process ctrl event publisher | ||
*/ | ||
ProcessCtrlEventPublisher getProcessCtrlEventPublisher(); | ||
|
||
/** | ||
* Gets get async process ctrl event publisher. | ||
* | ||
* @return the get async process ctrl event publisher | ||
*/ | ||
ProcessCtrlEventPublisher getAsyncProcessCtrlEventPublisher(); | ||
|
||
/** | ||
* Gets get application context. | ||
* | ||
* @return the get application context | ||
*/ | ||
ApplicationContext getApplicationContext(); | ||
|
||
/** | ||
* Gets get thread pool executor. | ||
* | ||
* @return the get thread pool executor | ||
*/ | ||
ThreadPoolExecutor getThreadPoolExecutor(); | ||
|
||
/** | ||
* Is enable async boolean. | ||
* | ||
* @return the boolean | ||
*/ | ||
boolean isEnableAsync(); | ||
|
||
/** | ||
* get ServiceInvokerManager | ||
* | ||
* @return the service invoker manager info | ||
*/ | ||
ServiceInvokerManager getServiceInvokerManager(); | ||
|
||
/** | ||
* get trans operation timeout | ||
* @return the transaction operate time out | ||
*/ | ||
int getTransOperationTimeout(); | ||
|
||
/** | ||
* get service invoke timeout | ||
* @return the service invoke time out | ||
*/ | ||
int getServiceInvokeTimeout(); | ||
|
||
/** | ||
* get ScriptEngineManager | ||
* | ||
* @return the script engine manager info | ||
*/ | ||
ScriptEngineManager getScriptEngineManager(); | ||
} |
Oops, something went wrong.