|
| 1 | +/////////////////////////////////////////////////////////////// |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + * or more contributor license agreements. See the NOTICE file |
| 4 | + * distributed with this work for additional information |
| 5 | + * regarding copyright ownership. The ASF licenses this file |
| 6 | + * to you under the Apache License, Version 2.0 (the |
| 7 | + * "License"); you may not use this file except in compliance |
| 8 | + * with the License. You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, |
| 13 | + * software distributed under the License is distributed on an |
| 14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + * KIND, either express or implied. See the License for the |
| 16 | + * specific language governing permissions and limitations |
| 17 | + * under the License. |
| 18 | +/////////////////////////////////////////////////////////////// |
| 19 | + |
| 20 | +[[library-execution,Execution Library]] |
| 21 | += Execution = |
| 22 | + |
| 23 | +== @Retry == |
| 24 | +Any method can be annotated with the @Retry annotation, which means that if there is an exception thrown, then |
| 25 | +the method should be called again, for a max number of times. |
| 26 | + |
| 27 | +The value() defines how many times the method will be called, if retry is triggered by the on() and unless() |
| 28 | +parameters. |
| 29 | + |
| 30 | +The backoff() parameter is available to slow down the retries, which is useful for network operations or |
| 31 | +external systems that may still need more time to become available. The default is no backoff is deployed and retries |
| 32 | +are executed as fast as possible. |
| 33 | + |
| 34 | +The on() parameter defines which Throwable and subclasses should be considered for retrying the method call. The |
| 35 | +default is all Throwables. |
| 36 | + |
| 37 | +The unless() parameter negates the on() parameter, and if a subclass of any Throwable listed in unless() is thrown |
| 38 | +then the retry operation(s) will not take effect. |
| 39 | + |
| 40 | +== ExecutionService == |
| 41 | +The =ExecutionService= is the =java.util.concurrent.ExecutorService= provided simply as a flexible assembler for |
| 42 | +configuration of it. |
| 43 | + |
| 44 | +=== Configuration Parameters === |
| 45 | +The Configuration parameters are available in the =ExecutionServiceAssembler= via a fluent API (DSL), with the |
| 46 | +following methods |
| 47 | + |
| 48 | +[snippet,java] |
| 49 | +---- |
| 50 | +source=libraries/execution/src/main/java/org/apache/polygene/library/execution/assembly/ExecutionServiceAssembler.java |
| 51 | +tag=configuration |
| 52 | +---- |
| 53 | + |
| 54 | + |
| 55 | +== ScheduledExecutionService == |
| 56 | +The =ScheduledExecutionService= is the =java.util.concurrent.ScheduledExecutorService= provided simply as a flexible |
| 57 | +assembler for configuration of it. |
| 58 | + |
| 59 | + |
| 60 | +=== Configuration Parameters === |
| 61 | +The Configuration parameters are available in the =ScheduledExecutionService= via a fluent API (DSL), with the |
| 62 | +following methods |
| 63 | + |
| 64 | +[snippet,java] |
| 65 | +---- |
| 66 | +source=libraries/execution/src/main/java/org/apache/polygene/library/execution/assembly/ScheduledExecutionService.java |
| 67 | +tag=configuration |
| 68 | +---- |
0 commit comments