1
|
icm-iis-primer
|
2
|
==============
|
3
|
|
4
|
The aim of this project is to provide a reusability method for Oozie workflows,
|
5
|
scripts and other file types by utilising import links.
|
6
|
|
7
|
The Primer traverses a specified Java package, looking for import links. When
|
8
|
found, it resolves them by creating new elements in the containing directory,
|
9
|
in accordance with the import link. The primed package is stored in a new
|
10
|
directory.
|
11
|
|
12
|
## Import links ##
|
13
|
Import links are defined as files following the specified format. They are
|
14
|
always named `import.txt`.
|
15
|
|
16
|
### Exemplary import link
|
17
|
|
18
|
## This is a classpath-based import file (this header is required)
|
19
|
from_jar classpath pl/edu/icm/coansys
|
20
|
workflow coansys pl.edu.icm.coansys.citations:inner-workflow:1.2-SNAPSHOT
|
21
|
|
22
|
The file starts with a compulsory header. Then, every line consists of the
|
23
|
following fields separated by whitespaces:
|
24
|
|
25
|
- destination - the name that will be given to the imported element
|
26
|
- import type - the type of imported element
|
27
|
- imported element description - additional information indentifying the
|
28
|
imported element (import type-specific)
|
29
|
|
30
|
The import file presented above will create a directory `from_jar` and
|
31
|
copy all the contents of `pl/edu/icm/coansys` into it. Additionally, it will
|
32
|
unpack `inner-workflow` into `workflow` directory.
|
33
|
|
34
|
### Supported import types ###
|
35
|
|
36
|
#### Classpath element ####
|
37
|
The element will be imported from the classpath (it can be either a file or
|
38
|
directory).
|
39
|
|
40
|
- **Import type:** `classpath`
|
41
|
- **Element description:** fully qualified resource name, using forward slashes
|
42
|
as separators.
|
43
|
|
44
|
#### CoAnSys Oozie Workflow Package ####
|
45
|
A CoAnSys Oozie Workflow Package will be imported and unpacked.
|
46
|
|
47
|
- **Import type:** `coansys`
|
48
|
- **Element description:** Maven-style package description, i.e.
|
49
|
`groupId:artifactId:version`
|
50
|
|
51
|
## Execution ##
|
52
|
Primer is executed from a Maven plugin implemented in
|
53
|
`icm-iis-primer-maven-plugin` project. Plugin usage is presented in
|
54
|
`icm-iis-primer-example` project.
|
55
|
|
56
|
## For developer ##
|
57
|
The main element of Primer is `Loader` class. It is a close relative of
|
58
|
Java `ClassLoader`. It should be provided with `ClassProviders`, which tell
|
59
|
where it should look for resources. By default, `JarClassProvider` and
|
60
|
`FileSystemClassProvider` are supplied. `Loader.prime` method executes the
|
61
|
priming process.
|
62
|
|
63
|
Another important class is `Resolver`. It is used when resolving import links.
|
64
|
It groups various `ResolvingServices`. Each import type should be assigned a
|
65
|
`ResolvingService`. Currently implemented `ResolvingServices` are
|
66
|
`ClasspathResolvingService` and `CoansysResolvingService`.
|