Skip to content

Commit

Permalink
Inactionware#99 Clear code
Browse files Browse the repository at this point in the history
  • Loading branch information
minjing committed Feb 19, 2019
1 parent 253ad2a commit 3748082
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 359 deletions.
5 changes: 0 additions & 5 deletions uapi.app/src/main/java/uapi/app/internal/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ public class Application {
private static final String BEHAVIOR_STARTUP = "startUp";
private static final String BEHAVIOR_SHUTDOWN = "shutdown";

// private final IAnonymousAction DEFAULT_FAILURE_ACTION = (failure, ctx) -> {
// this._logger.error(failure.cause(), "Fail to process behavior - {}", ctx.behaviorName());
// return null;
// };

private final IBehaviorFailureCall DEFAULT_FAILURE_ACTION = (failure, ctx) -> {
this._logger.error(failure.cause(), "Fail to process behavior - {}", ctx.behaviorName());
return null;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import uapi.behavior.annotation.ActionDo;
import uapi.codegen.*;
import uapi.common.Numeric;
import uapi.common.StringHelper;
import uapi.rx.Looper;
import uapi.service.IServiceHandlerHelper;
import uapi.service.annotation.Service;
Expand Down Expand Up @@ -181,42 +180,6 @@ public ActionMethodMeta parseActionMethod(Element classElement) {
paramMetas[idx] = paramMeta;
});
return new ActionMethodMeta(actionMethodName, paramMetas);

// String inputType;
// String outputType;
// boolean needContext = false;
// if (paramElements.size() == 0) {
// throw new GeneralException(
// "The method annotated with ActionDo must contains 1 or 2 parameters - {}::{}",
// classElement.getSimpleName().toString(), actionMethodName);
// } else if (paramElements.size() > 2) {
// throw new GeneralException(
// "The method annotated with ActionDo must contains more than 2 parameters - {}::{}",
// classElement.getSimpleName().toString(), actionMethodName);
// } else {
// VariableElement inputParamElement = (VariableElement) paramElements.get(0);
// inputType = inputParamElement.asType().toString();
// if (paramElements.size() == 1) {
// if (IExecutionContext.class.getCanonicalName().equals(inputType)) {
// inputType = Type.VOID;
// needContext = true;
// }
// } else if (paramElements.size() == 2) {
// VariableElement contextParamElement = (VariableElement) paramElements.get(1);
// if (! IExecutionContext.class.getCanonicalName().equals(contextParamElement.asType().toString())) {
// throw new GeneralException(
// "The second parameter of method which annotated with ActionDo must be IExecutionContext - {}::{}",
// classElement.getSimpleName().toString(), actionMethodName);
// }
// needContext = true;
// }
// }
// outputType = actionDoElement.getReturnType().toString();
// // convert native type to associated qualified type
// inputType = Type.toQType(inputType);
// outputType = Type.toQType(outputType);
//
// return new ActionMethodMeta(inputType, outputType, actionMethodName, needContext);
}
}
}
11 changes: 0 additions & 11 deletions uapi.behavior/src/main/java/uapi/behavior/ActionOutputMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,4 @@ public boolean equals(Object other) {
ActionOutputMeta otherMeta = (ActionOutputMeta) other;
return this._name.equals(otherMeta._name) || this._type.equals(otherMeta._type);
}

// public void verifyInput(Object input) {
// if (! this.type().isAssignableFrom(input.getClass())) {
// throw BehaviorException.builder()
// .errorCode(BehaviorErrors.INPUT_OUTPUT_NOT_MATCH)
// .variables(new BehaviorErrors.InputOutputNotMatch()
// .outputMeta(this)
// .input(input))
// .build();
// }
// }
}
101 changes: 0 additions & 101 deletions uapi.behavior/src/main/java/uapi/behavior/ActionResult.java

This file was deleted.

3 changes: 0 additions & 3 deletions uapi.behavior/src/main/java/uapi/behavior/BehaviorEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
import uapi.common.ArgumentChecker;
import uapi.event.AttributedEvent;

import java.util.HashMap;
import java.util.Map;

/**
* The implementation for IBehaviorEvent interface
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public BehaviorFailure(
) {
ArgumentChecker.required(failureAction, "failureAction");
ArgumentChecker.required(failureInputs, "failureInput");
// ArgumentChecker.required(cause, "cause");

this._failureAction = failureAction;
this._failureInputs = failureInputs;
Expand Down
10 changes: 0 additions & 10 deletions uapi.behavior/src/main/java/uapi/behavior/IAnonymousAction.java

This file was deleted.

29 changes: 0 additions & 29 deletions uapi.behavior/src/main/java/uapi/behavior/IBehaviorBuilder.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package uapi.behavior;

import uapi.common.Functionals;
import uapi.event.IEventFinishCallback;

/**
* A builder for behavior creation
Expand Down Expand Up @@ -83,30 +82,6 @@ public interface IBehaviorBuilder {
*/
IBehaviorBuilder then(Class<? extends IAction> actionType, String label, Object... inputs) throws BehaviorException;

/**
* Set next an anonymous action when current branch condition is satisfied.
*
* @param action
* The anonymous action
* @return The behavior builder self
* @throws BehaviorException
* Any cause when set action
*/
// IBehaviorBuilder then(IAnonymousAction action) throws BehaviorException;

/**
* Set next an anonymous action with specific label when current branch condition is satisfied.
*
* @param action
* The anonymous action
* @param label
* The action/behavior label which can be used to navigate to it later
* @return The behavior builder self
* @throws BehaviorException
* Any cause when set action
*/
// IBehaviorBuilder then(IAnonymousAction action, String label) throws BehaviorException;

/**
* Set next an anonymous action which return nothing when current branch condition is satisfied.
*
Expand Down Expand Up @@ -140,8 +115,6 @@ public interface IBehaviorBuilder {
*/
IBehaviorBuilder onSuccess(IBehaviorSuccessCall action);

// IBehaviorBuilder onSuccess(ActionIdentify actionId);

/**
* Invoke the action when the behavior is executed failed
*
Expand All @@ -151,8 +124,6 @@ public interface IBehaviorBuilder {
*/
IBehaviorBuilder onFailure(IBehaviorFailureCall action);

// IBehaviorBuilder onFailure(ActionIdentify actionId);

/**
* Get navigator which associated with this behavior builder
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

import java.util.Map;

import uapi.behavior.BehaviorEvent;

/**
* Store context during execution time
*/
Expand Down
7 changes: 0 additions & 7 deletions uapi.behavior/src/main/java/uapi/behavior/INavigator.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ public interface INavigator {
*/
IBehaviorBuilder moveToStarting();

/**
* Move current cursor to previous action
*
* @return The associated behavior builder
*/
// IBehaviorBuilder moveToPrevious();

/**
* Move current cursor to specific labeled action.
*
Expand Down
14 changes: 0 additions & 14 deletions uapi.behavior/src/main/java/uapi/behavior/IResponsible.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,6 @@ IBehaviorBuilder newBehavior(
Class<? extends IEvent> eventType,
String topic) throws BehaviorException;

/**
* Create new behavior builder on specific input data type which can handled by the behavior.
*
* @param types
* The data types which can be handled by the behavior
* @return The behavior builder
* @throws BehaviorException
* The name is used in other behavior, error code see {@link BehaviorErrors.BEHAVIOR_ID_IS_USED}
*/
// IBehaviorBuilder newBehavior(
// String name,
// Class<?> type
// ) throws BehaviorException;

IBehaviorBuilder newBehavior(
String name,
Class<?> ... types
Expand Down
Loading

0 comments on commit 3748082

Please sign in to comment.