Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
topframe committed Jun 21, 2023
1 parent eb54eec commit 42fce6d
Show file tree
Hide file tree
Showing 30 changed files with 554 additions and 409 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
ij_java_class_count_to_use_import_on_demand = 999
ij_java_names_count_to_use_import_on_demand = 999
ij_java_packages_to_use_import_on_demand = java.awt.*, javax.swing.*

[*.{xml,apon,sql}]
indent_style = space
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public abstract class AbstractActivity implements Activity {

/**
* Instantiates a new abstract activity.
*
* @param context the activity context
*/
protected AbstractActivity(ActivityContext context) {
Expand All @@ -64,7 +63,6 @@ public Environment getEnvironment() {

/**
* Gets the current activity.
*
* @return the current activity
*/
protected Activity getCurrentActivity() {
Expand Down Expand Up @@ -113,7 +111,6 @@ public SessionAdapter getSessionAdapter() {

/**
* Sets the session adapter.
*
* @param sessionAdapter the new session adapter
*/
protected void setSessionAdapter(SessionAdapter sessionAdapter) {
Expand All @@ -127,7 +124,6 @@ public RequestAdapter getRequestAdapter() {

/**
* Sets the request adapter.
*
* @param requestAdapter the new request adapter
*/
protected void setRequestAdapter(RequestAdapter requestAdapter) {
Expand All @@ -141,7 +137,6 @@ public ResponseAdapter getResponseAdapter() {

/**
* Sets the response adapter.
*
* @param responseAdapter the new response adapter
*/
protected void setResponseAdapter(ResponseAdapter responseAdapter) {
Expand Down
45 changes: 9 additions & 36 deletions core/src/main/java/com/aspectran/core/activity/Activity.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,20 @@
import java.util.List;

/**
* Activities are one task in which Aspectran services process requests.
* An activity is a set of actions that an Aspectran service performs to process a request.
*
* <p>Created: 2008. 03. 22 PM 5:48:09</p>
*/
public interface Activity {

/**
* Performs the prepared activity.
*
* @throws ActivityPerformException thrown when an exception occurs while performing an activity
*/
void perform() throws ActivityPerformException;

/**
* Performs the given instant activity.
*
* @param <V> the result type of the instant action
* @param instantAction the instant action
* @return An object that is the result of performing an instant activity
Expand All @@ -60,81 +58,76 @@ public interface Activity {

/**
* Throws an ActivityTerminatedException to terminate the current activity.
*
* @throws ActivityTerminatedException if an activity terminated without completion
*/
void terminate() throws ActivityTerminatedException;

/**
* Throws an ActivityTerminatedException with the reason for terminating the current activity.
*
* @param cause the termination cause
* @throws ActivityTerminatedException the exception to terminate activity
*/
void terminate(String cause) throws ActivityTerminatedException;

/**
* Returns an instance of the current translet.
*
* @return an instance of the current translet
*/
Translet getTranslet();

/**
* Returns the process result.
*
* @return the process result
*/
ProcessResult getProcessResult();

/**
* Returns an action result for the specified action id from the process result,
* or {@code null} if the action does not exist.
*
* @param actionId the specified action id
* @return an action result
*/
Object getProcessResult(String actionId);

/**
* Returns the originally declared response.
*
* @return the declared response
* @since 5.2.0
*/
Response getDeclaredResponse();

/**
* Returns whether the response is reserved.
*
* @return true, if the response is reserved
*/
boolean isResponseReserved();

/**
* Returns whether the exception was thrown.
*
* @return true, if is exception raised
* Returns whether a response was attempted after performing the activity.
* @return true if a response was attempted, false otherwise
*/
boolean isCommitted();

/**
* Returns whether an exception was thrown in the activity.
* @return true if there was an exception thrown by the activity, false otherwise
*/
boolean isExceptionRaised();

/**
* Returns an instance of the currently raised exception.
*
* @return an instance of the currently raised exception
*/
Throwable getRaisedException();

/**
* Returns the innermost one of the chained (wrapped) exceptions.
*
* @return the innermost one of the chained (wrapped) exceptions
*/
Throwable getRootCauseOfRaisedException();

/**
* Sets an instance of the currently raised exception.
*
* @param raisedException an instance of the currently raised exception
*/
void setRaisedException(Throwable raisedException);
Expand All @@ -146,7 +139,6 @@ public interface Activity {

/**
* Register an aspect rule dynamically.
*
* @param aspectRule the aspect rule
* @throws AdviceConstraintViolationException thrown when an Advice Constraint Violation occurs
* @throws AspectAdviceException thrown when an error occurs while running advice
Expand All @@ -156,14 +148,12 @@ void registerAspectAdviceRule(AspectRule aspectRule)

/**
* Register a settings advice rule dynamically.
*
* @param settingsAdviceRule the settings advice rule
*/
void registerSettingsAdviceRule(SettingsAdviceRule settingsAdviceRule);

/**
* Execute aspect advices with given rules.
*
* @param aspectAdviceRuleList the aspect advice rules
* @param throwable whether to raise an exception
* @throws AspectAdviceException thrown when an error occurs while running advice
Expand All @@ -172,7 +162,6 @@ void registerAspectAdviceRule(AspectRule aspectRule)

/**
* Executes an aspect advice with a given rule.
*
* @param aspectAdviceRule the aspect advice rule
* @param throwable whether to raise an exception
* @throws AspectAdviceException thrown when an error occurs while running advice
Expand All @@ -181,15 +170,13 @@ void registerAspectAdviceRule(AspectRule aspectRule)

/**
* Exception handling.
*
* @param exceptionRuleList the exception rule list
* @throws ActionExecutionException thrown when an error occurs while executing an action
*/
void handleException(List<ExceptionRule> exceptionRuleList) throws ActionExecutionException;

/**
* Gets the specified setting value from the current activity scope.
*
* @param <V> the type of the value
* @param name the setting name
* @return the setting value
Expand All @@ -198,15 +185,13 @@ void registerAspectAdviceRule(AspectRule aspectRule)

/**
* Puts the specified setting value in the current activity scope.
*
* @param name the setting name
* @param value the setting value
*/
void putSetting(String name, Object value);

/**
* Gets the aspect advice bean.
*
* @param <V> the type of the bean
* @param aspectId the aspect id
* @return the aspect advice bean object
Expand All @@ -215,49 +200,42 @@ void registerAspectAdviceRule(AspectRule aspectRule)

/**
* Gets the activity context.
*
* @return the activity context
*/
ActivityContext getActivityContext();

/**
* Returns the environment of the current activity context.
*
* @return the environment
*/
Environment getEnvironment();

/**
* Gets the application adapter.
*
* @return the application adapter
*/
ApplicationAdapter getApplicationAdapter();

/**
* Gets the session adapter.
*
* @return the session adapter
*/
SessionAdapter getSessionAdapter();

/**
* Gets the request adapter.
*
* @return the request adapter
*/
RequestAdapter getRequestAdapter();

/**
* Gets the response adapter.
*
* @return the response adapter
*/
ResponseAdapter getResponseAdapter();

/**
* Returns an instance of the bean that matches the given id.
*
* @param <V> the result type of the bean
* @param id the id of the bean to retrieve
* @return an instance of the bean
Expand All @@ -266,7 +244,6 @@ void registerAspectAdviceRule(AspectRule aspectRule)

/**
* Returns an instance of the bean that matches the given object type.
*
* @param <V> the result type of the bean
* @param type the type the bean must match; can be an interface or superclass.
* {@code null} is disallowed.
Expand All @@ -277,7 +254,6 @@ void registerAspectAdviceRule(AspectRule aspectRule)

/**
* Returns an instance of the bean that matches the given object type.
*
* @param <V> the result type of the bean
* @param type type the bean must match; can be an interface or superclass.
* {@code null} is allowed.
Expand All @@ -291,23 +267,20 @@ void registerAspectAdviceRule(AspectRule aspectRule)

/**
* Returns whether a bean with the specified id is present.
*
* @param id the id of the bean to query
* @return whether a bean with the specified id is present
*/
boolean containsBean(String id);

/**
* Returns whether a bean with the specified object type is present.
*
* @param type the object type of the bean to query
* @return whether a bean with the specified type is present
*/
boolean containsBean(Class<?> type);

/**
* Returns whether the bean corresponding to the specified object type and ID exists.
*
* @param type the object type of the bean to query
* @param id the id of the bean to query
* @return whether a bean with the specified type is present
Expand Down

0 comments on commit 42fce6d

Please sign in to comment.