Skip to content

Commit 2f88e68

Browse files
Add variable injector to the readme file
1 parent 1a5ddc0 commit 2f88e68

File tree

1 file changed

+27
-30
lines changed

1 file changed

+27
-30
lines changed

README.md

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -849,9 +849,9 @@ When creating the archive, the tool will try to gather all binaries, scripts, an
849849

850850
An optional feature for the Discover Domain is the Variable Injector tool. The variable injector will replace a selected model attribute value with a property marker containing a unique variable name. This variable name and the replaced value are inserted into a variable property file.
851851

852-
To enable the Variable Injector during the Discover Domain, you must place a json file named model_variable_injector.json into the <WLSDEPLOY>/lib directory. This file must be manually created and contain one of the pre-defined keywords and/or a CUSTOM designated file.
852+
To enable the Variable Injector during the Discover Domain, you must place a json file named model_variable_injector.json into the WLSDEPLOY/lib directory. This file must be manually created and contain one of the pre-defined keywords and/or a CUSTOM designated file.
853853

854-
A variable name substitution is only performed once for an attribute during the variable injector run. The first substitution is not replaced by and subsequent matches.
854+
A variable name substitution is only performed once for an attribute during the variable injector run. The first substitution is not replaced by any subsequent matches.
855855

856856
The supported keywords are as follows:
857857

@@ -874,9 +874,9 @@ The supported keywords are as follows:
874874
- URL
875875
All MBean URL attribute values in the model are injected with a variable property string and the string and value placed in the variable property file
876876

877-
These special keywords are defined in a keyword file that is installed into the <WLSDEPLOY>/lib directory. Each keyword is associated with an injector json file.
878-
Each injector json file is installed into the <WLSDEPLOY>/lib/injectors directory. An injector file contains the directives for the Variable Injector tool to
879-
inject variables into specific model attributes.
877+
These special keywords are defined in a keyword file that is installed into the WLSDEPLOY/lib directory. Each keyword is associated with an injector json file.
878+
Each injector json file is installed into the WLSDEPLOY/lib/injectors directory. An injector file contains the directives for the Variable Injector tool to
879+
inject variable names into specified model attributes.
880880

881881
Here is an example of a model_variable_injector.json file using the PORT keyword.
882882

@@ -886,7 +886,7 @@ Here is an example of a model_variable_injector.json file using the PORT keyword
886886
}
887887
```
888888

889-
Below is a model snippet that shows injected variables for the port values in a topology section.
889+
Below is a model snippet that shows injected variables in the port attributes.
890890

891891
```$yaml
892892
@@ -914,7 +914,7 @@ topology:
914914
ListenPort: @@PROP:Server.SSL.soa_server1.ListenPort@@
915915
soa_server2:
916916
ListenAddress: managed2.example.com
917-
ListenPort: @@PROP:Server.so_server2.ListenPort@@
917+
ListenPort: @@PROP:Server.soa_server2.ListenPort@@
918918
Cluster: soa_cluster
919919
Machine: machine3
920920
SSL:
@@ -923,14 +923,12 @@ topology:
923923
924924
And the resulting variable property file:
925925
926-
```txt
927926
Server.AdminServer.ListenPort=7001
928927
Server.AdminServer.SSL.ListenPort=7002
929928
Server.soa_server1.ListenPort=8001
930929
Server.soa_server1.SSL.ListenPort=8002
931930
Server.soa_server2.ListenPort=8001
932931
Server.soa_server2.SSL.ListenPort=8002
933-
```
934932
935933
To designate the name and location of the variable properties file, include the variable_file_name directive in the model_variable_injector.json file.
936934
@@ -942,18 +940,17 @@ To designate the name and location of the variable properties file, include the
942940

943941
If this directive is not included in the json file, the model or archive file name and location is used to create the variable properties file name and location. If the model_file command line
944942
argument is used on the Discover Domain run, the properties file name and location will be the same as the model file, with the file extension `.properties`. If only the archive file argument is present, the archive file name
945-
and location will be used to create the variable properties file name and location.
943+
and location will be used.
946944

947945
As with the archive and model file, each run of the discover domain tool will overwrite the contents of an existing variable property file with the values from the current run.
948946

949-
# Custom Variable Injector
947+
### Custom Variable Injector
950948

951949
You may customize the injector attribute replacement by using the CUSTOM keyword in the model_variable_injector.json. The CUSTOM keyword identifies a list of one or more custom injector json files.
952-
These injector json files will be processed first, in list order, and the resulting variable properties will not be replaced when processing additional keywords in the model variable injector json file.
953-
954-
An entry in the injector json file is a key that specifies the unique MBean attribute that will be injected, and an optional set of directives.
950+
These injector json files will be processed by the Variable Injector tool first, in list order. Any resulting variable replacement will not be overlaid when processing additional keywords.
955951

956-
The injector is a period separated MBean hierarchy and attribute name as they are defined in the model. Do not enter the name of the model section into the injector key.
952+
An entry in the injector json file is a key that specifies the unique MBean attribute to parameterize, and an optional set of directives. The injector is a period separated MBean hierarchy and attribute name as they are defined in the model.
953+
Do not enter the name of the model section into the injector key.
957954

958955
For example, an injector key for the Server SSL Listen Port is Server.SSL.ListenPort. The Server.SSL identifies the hierarchy in the model to the attribute.
959956

@@ -976,26 +973,26 @@ topology:
976973
ListenPort: 7002
977974
```
978975
979-
The Variable Injector tool will inject a unique variable name for every server in the model that has the Server/SSL/ListenPort attribute.
976+
For this example, the Variable Injector tool will inject a unique variable name for every server in the model that has the Server/SSL/ListenPort attribute.
980977
981-
# Custom special directives
978+
#### Custom special directives
982979
983980
The following directives can refine the variable injection.
984981
985982
- force:<true|false>
986983
For true, if the MBean hierarchy exists in the model, but the attribute does not, then the attribute will be added and persisted to the discovered model. The value stored in the
987984
model is the weblogic default value.
988985
989-
- variable_value:<value>
986+
- variable_value:
990987
Replace the model value with the specified value in the variable properties. This may be used in conjunction with the force directive, replacing the default value with the indicated value.
991988
992-
-regexp:<list of regular expression directives>
989+
- regexp:
993990
A list of regexp patterns that will be applied to either the string values or map values of an attribute in the model. If the pattern matches, then the matching part of the
994991
string or dictionary will be injected with a unique variable name.
995-
-pattern:<regexp pattern>
996-
the regular expression pattern to apply to the string value or map values of an attribute
997-
-suffix:<suffix name>
998-
The suffix name to append to each resulting variable name in the variable properties file
992+
-- pattern:
993+
the regular expression pattern to apply to the string value or map values of an attribute
994+
-- suffix:
995+
The suffix name to append to each resulting variable name in the variable properties file
999996
1000997
The regexp list is useful when only a segment of a string value needs to be parameterized (making for quick manipulation of the variable properties). If more than one
1001998
pattern is specified in the regexp directive list, then a suffix MUST be added in order to generate a unique variable name.
@@ -1033,14 +1030,14 @@ We create a directive in our custom injector json file:
10331030

10341031
During the Discover Domain tool run, the pattern is applied to the URL string, and the resulting entries added to the variable properties:
10351032

1036-
- URL: 'jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=@@PROP:JDBCSystemResource.Database1.JdbcResource.JDBCDriverParams.URL--Host@@:)(PORT=@@PROP:JDBCSystemResource.Database1.JdbcResource.JDBCDriverParams.URL--Port@@)))(CONNECT_DATA=(SERVICE_NAME=orcl.us.oracle.com)))'
1037-
-
1038-
JDBCSystemResource.Database1.JdbcResource.JDBCDriverParams.URL--Host=slc05til.us.oracle.com
1039-
JDBCSystemResource.Database1.JdbcResource.JDBCDriverParams.URL--Port=1521
1033+
URL: 'jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=@@PROP:JDBCSystemResource.Database1.JdbcResource.JDBCDriverParams.URL--Host@@:)(PORT=@@PROP:JDBCSystemResource.Database1.JdbcResource.JDBCDriverParams.URL--Port@@)))(CONNECT_DATA=(SERVICE_NAME=orcl.us.oracle.com)))'
1034+
1035+
JDBCSystemResource.Database1.JdbcResource.JDBCDriverParams.URL--Host=slc05til.us.oracle.com
1036+
JDBCSystemResource.Database1.JdbcResource.JDBCDriverParams.URL--Port=1521
10401037

1041-
## Selecting specific MBean names for variable injection
1038+
### Selecting specific MBean names for variable injection
10421039

1043-
The final custom directive allows you to explicitly define which named entries for an MBean in the model you wish to inject properties. For instance, you might wish to parameterize an attribute for a specific server, or for all the managed servers.
1040+
The final custom directive allows you to explicitly define which named entries for an MBean in the model you wish to inject properties. For instance, you might wish to parameterize an attribute just for a specific set of servers.
10441041
To define a list of one or more names of an MBean, add a user directive to the injector keyword value. The user directive is added to the end of an MBean between brackets. For instance, to select only the admin server named AdminServer, add the
10451042
user directive to the Server MBean - Server[AdminServer]. To select servers soa_server1 and soa_server2 from the model, create the injector key Server[soa_server1,soa_server2]
10461043

@@ -1054,7 +1051,7 @@ A custom injector to parameterize the admin server SSL listen port is:
10541051
}
10551052
```
10561053

1057-
A sample of a model_variable_injector.json file and a custom injector json file are installed in the <WLSDEPLOY>/samples directory.
1054+
A sample of a model_variable_injector.json file and a custom injector json file are installed in the WLSDEPLOY/samples directory.
10581055

10591056

10601057
## Downloading and Installing the Software

0 commit comments

Comments
 (0)