-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 0cc1e06.
- Loading branch information
Showing
7 changed files
with
220 additions
and
251 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* [BoxLang] | ||
* | ||
* Copyright [2023] [Ortus Solutions, Corp] | ||
* | ||
* 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 bifs; | ||
|
||
import ortus.boxlang.runtime.bifs.BIF; | ||
import ortus.boxlang.runtime.bifs.BoxBIF; | ||
import ortus.boxlang.runtime.context.IBoxContext; | ||
import ortus.boxlang.runtime.scopes.ArgumentsScope; | ||
|
||
@BoxBIF | ||
public class Hola extends BIF { | ||
|
||
/** | ||
* Hola | ||
* | ||
* @param context The context in which the BIF is being invoked. | ||
* @param arguments Argument scope for the BIF. | ||
*/ | ||
public String _invoke( IBoxContext context, ArgumentsScope arguments ) { | ||
return "Hola Mundo!"; | ||
} | ||
} |
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,69 @@ | ||
/** | ||
* [BoxLang] | ||
* | ||
* Copyright [2023] [Ortus Solutions, Corp] | ||
* | ||
* 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 components; | ||
|
||
import ortus.boxlang.runtime.components.Attribute; | ||
import ortus.boxlang.runtime.components.BoxComponent; | ||
import ortus.boxlang.runtime.components.Component; | ||
import ortus.boxlang.runtime.context.IBoxContext; | ||
import ortus.boxlang.runtime.scopes.Key; | ||
import ortus.boxlang.runtime.types.IStruct; | ||
import ortus.boxlang.runtime.types.exceptions.AbortException; | ||
import ortus.boxlang.runtime.types.exceptions.CustomException; | ||
|
||
@BoxComponent | ||
public class ModuleAbort extends Component { | ||
|
||
/** | ||
* -------------------------------------------------------------------------- | ||
* Constructor(s) | ||
* -------------------------------------------------------------------------- | ||
*/ | ||
|
||
public ModuleAbort() { | ||
super(); | ||
declaredAttributes = new Attribute[] { | ||
new Attribute( Key.showerror, "string" ), | ||
new Attribute( Key.type, "string", "request" ) | ||
}; | ||
} | ||
|
||
/** | ||
* Tests for a parameter's existence, tests its data type, and, if a default value is not assigned, optionally provides one. | ||
* | ||
* @param context The context in which the Component is being invoked | ||
* @param attributes The attributes to the Component | ||
* @param body The body of the Component | ||
* @param executionState The execution state of the Component | ||
* | ||
* @attribute.showerror Whether to show an error | ||
* | ||
* @attribute.type The type of the abort (request or page) | ||
* | ||
*/ | ||
public BodyResult _invoke( IBoxContext context, IStruct attributes, ComponentBody body, IStruct executionState ) { | ||
String showerror = attributes.getAsString( Key.showerror ); | ||
String type = attributes.getAsString( Key.type ); | ||
|
||
Throwable cause = null; | ||
if ( showerror != null && !showerror.isEmpty() ) { | ||
cause = new CustomException( showerror ); | ||
} | ||
throw new AbortException( type, cause ); | ||
} | ||
} |
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,113 @@ | ||
/** | ||
* [BoxLang] | ||
* | ||
* Copyright [2023] [Ortus Solutions, Corp] | ||
* | ||
* 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 config; | ||
|
||
import java.util.Optional; | ||
|
||
import ortus.boxlang.runtime.async.tasks.BaseScheduler; | ||
import ortus.boxlang.runtime.async.tasks.IScheduler; | ||
import ortus.boxlang.runtime.async.tasks.ScheduledTask; | ||
|
||
public class Scheduler extends BaseScheduler implements IScheduler { | ||
|
||
public Scheduler() { | ||
super( "ModuleScheduler" ); | ||
} | ||
|
||
/** | ||
* Declare the tasks for this scheduler | ||
*/ | ||
@Override | ||
public void configure() { | ||
task( "PeriodicalTask" ) | ||
.call( () -> System.out.println( "++++++ >>>>>> Hello from MyModuleTask" ) ) | ||
.everySecond() | ||
.onFailure( ( task, exception ) -> System.out.println( "MyModuleTask failed: " + exception.getMessage() ) ) | ||
.onSuccess( ( task, result ) -> System.out.println( "MyModuleTask succeeded: " + result ) ); | ||
|
||
task( "OneOffTask" ) | ||
.call( () -> System.out.println( "++++++ >>>>>> Hello from OneOffTask" ) ); | ||
|
||
xtask( "A Disabled Task" ) | ||
.call( () -> System.out.println( "Hello from A Disabled Task" ) ) | ||
.everySecond(); | ||
} | ||
|
||
/** | ||
* Called before the scheduler is going to be shutdown | ||
*/ | ||
@Override | ||
public void onShutdown() { | ||
System.out.println( "[onShutdown] ==> Bye bye from the Module Scheduler!" ); | ||
} | ||
|
||
/** | ||
* Called after the scheduler has registered all schedules | ||
*/ | ||
@Override | ||
public void onStartup() { | ||
System.out.println( "[onStartup] ==> The Module Scheduler is in da house!!!!!" ); | ||
} | ||
|
||
/** | ||
* Called whenever ANY task fails | ||
* | ||
* @task The task that got executed | ||
* | ||
* @exception The ColdFusion exception object | ||
*/ | ||
@Override | ||
public void onAnyTaskError( ScheduledTask task, Exception exception ) { | ||
System.out.println( "[onAnyTaskError] ==> " + task.getName() + " task just went kabooooooom!" ); | ||
} | ||
|
||
/** | ||
* Called whenever ANY task succeeds | ||
* | ||
* @task The task that got executed | ||
* | ||
* @result The result (if any) that the task produced | ||
*/ | ||
@Override | ||
public void onAnyTaskSuccess( ScheduledTask task, Optional<?> result ) { | ||
System.out.println( "[onAnyTaskSuccess] ==> " + task.getName() + " task completed!" ); | ||
} | ||
|
||
/** | ||
* Called before ANY task runs | ||
* | ||
* @task The task about to be executed | ||
*/ | ||
@Override | ||
public void beforeAnyTask( ScheduledTask task ) { | ||
System.out.println( "[beforeAnyTask] ==> I am running before the task: " + task.getName() ); | ||
} | ||
|
||
/** | ||
* Called after ANY task runs | ||
* | ||
* @task The task that got executed | ||
* | ||
* @result The result (if any) that the task produced | ||
*/ | ||
@Override | ||
public void afterAnyTask( ScheduledTask task, Optional<?> result ) { | ||
System.out.println( "[afterAnyTask] ==> I am running after the task: " + task.getName() ); | ||
} | ||
|
||
} |
92 changes: 0 additions & 92 deletions
92
src/main/java/ortus/boxlang/runtime/bifs/global/query/QueryFilter.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.