You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-33Lines changed: 28 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -847,13 +847,13 @@ When creating the archive, the tool will try to gather all binaries, scripts, an
847
847
848
848
## The Variable Injector Tool
849
849
850
-
The variable injector tool is used to parameterize a model with variables. These variables are assigned values by you in the external variable properties file. This facilitates the ease of using the same domain model to create new domains in different environments. You can run the variable injector tool as an option in the Discover Domain tool, or you can update a model with variables with the stand-alone command line interface.
850
+
The variable injector tool is used to tokenize a model with variables. You assign a value for a variable in an external variable properties file. This facilitates using the same domain model to create new domains in different environments. You can run the variable injector tool as an option in the Discover Domain tool, or you can update a model with variables with the stand-alone command line interface.
851
851
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 Variable Injector pre-defined keywords and/or a CUSTOM designated file. A keyword points to, and the custom file is, an injector directive file. These injector directives control how the variables are injected into the model and variable properties file.
852
+
To enable the Variable Injector during the Discover Domain, you place a json file named model_variable_injector.json into the \<WLSDEPLOY\>/lib directory. This file will tell the injector tool which model attributes to tokenize. You create it with one of the injector's pre-defined keywords and/or a CUSTOM file or files. A keyword points to, and the custom file is, an injector directive file. These injector directives control which variables are injected into the model and variable properties file.
853
853
854
-
As the directives are processed by the Variable Injector tool, a model attribute is assessed for a match for parameterization, and a property token and a unique variable name is injected into the attribute in the model. The variable name, and the model value, are placed into the external variable properties file. A variable name substitution on a model attribute is only performed once during the variable injector run. The first substitution is not replaced by any subsequent matches.
854
+
As these directives are applied to the model, each model attribute is assessed for a match. If the attribute matches a directive, then a property token and a unique variable name is injected into the attribute. The variable name, and the model value, are placed into the external variable properties file. A variable name substitution on a model attribute is only performed once during the variable injector run. The first substitution is not replaced by any subsequent matches.
855
855
856
-
The Discover Domain tool calls the variable injector after the model has been discovered and any filters processed. The subsequent model and variable file are then validated with the validator tool.
856
+
The Discover Domain tool calls the variable injector after the model has been discovered and any filters processed. After variables have been injected by the tool, the model and variable file are validated with the validator tool.
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
944
-
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
935
+
To specify the name and location of the variable properties file, you can use the argument `-variable_properties_file` on the discover domain command line. If you use this command line argument, the model variable injector file must exist in the \<WLSDEPLOY\>/lib directory.
936
+
If the model variable injector file exists in the directory, but the command line argument is not used, the variable properties file will be named as follows: If the model_file command line 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
937
and location will be used.
946
938
947
939
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.
948
940
949
941
### Custom Variable Injector
950
942
951
-
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 by the Variable Injector tool first, in list order. Any resulting variable replacement will not be overlaid when processing additional keywords.
943
+
You may designate custom injector directives by using the CUSTOM keyword in the model_variable_injector.json. On the CUSTOM keyword, you identify a list of one or more custom injector directive json files. An entry in the injector json file is a key that specifies the unique MBean attribute to tokenize, and an optional set of directives. 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.
953
944
954
-
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.
955
-
Do not enter the name of the model section into the injector key.
956
-
957
-
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.
945
+
For example, an injector key for the Server SSL Listen Port is as below.
958
946
959
947
```json
960
948
{
961
949
"Server.SSL.ListenPort": {},
962
950
}
963
951
```
964
952
965
-
An example of that hierarchy in a model (notice that the MBean name of AdminServer is NOT included):
953
+
Note the hierarchy of MBeans in the model for the ListenPort attribute and note that the MBean name of AdminServer is NOT included in the directive:
954
+
966
955
```yaml
967
956
topology:
968
957
Server:
@@ -975,29 +964,28 @@ topology:
975
964
ListenPort: 7002
976
965
```
977
966
978
-
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.
967
+
These custom injector json files will be processed by the Variable Injector tool before keywords, each file processed in list order. A property injected into an attribute will not be replaced by any subsequent matches.
979
968
980
969
#### Custom special directives
981
970
982
971
The following directives can refine the variable injection.
983
972
984
-
- force:<true|false>
985
-
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
973
+
- force:<attribute>
974
+
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
986
975
model is the weblogic default value.
987
976
988
977
- variable_value:
989
978
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.
990
979
991
980
- regexp:
992
981
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
993
-
string or dictionary will be injected with a unique variable name.
982
+
string or dictionary will be injected with a property token and a unique variable name.
994
983
-- pattern:
995
984
the regular expression pattern to apply to the string value or map values of an attribute
996
985
-- suffix:
997
-
The suffix name to append to each resulting variable name in the variable properties file
986
+
The suffix name to append to each resulting variable name in order to create a unique variable name
998
987
999
-
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
1000
-
pattern is specified in the regexp directive list, then a suffix MUST be added in order to generate a unique variable name.
988
+
The regexp list is useful when only a segment of a string value or map needs to be injected (giving you a clean list of property values in the variable properties file). You can inject more than one token into a string or map with multiple patterns. However, when you have more than one pattern, you must provide a suffix for each. This allows the tool to generate a unique variable name for each token in the string or map.
1001
989
1002
990
The following is an example of how to effectively use the regexp directive list to search for a segment in a string value. In this example, we want to search for
1003
991
the host and port in each Oracle JDBC URL that uses the special Oracle URL notation, and create an entry for the host and port in the variable properties file.
@@ -1030,24 +1018,31 @@ We create a directive in our custom injector json file:
1030
1018
},
1031
1019
```
1032
1020
1033
-
During the Discover Domain tool run, the pattern is applied to the URL string, and the resulting entries added to the variable properties:
1021
+
During the Discover Domain tool run, the pattern is applied to the URL string and tokens injected into the string:
#### Selecting specific MBean names for variable injection
1043
1035
1044
-
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.
1045
-
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
1046
-
user directive to the Server MBean - Server[AdminServer]. To select servers soa_server1 and soa_server2 from the model, the injector key is Server[soa_server1,soa_server2]
1036
+
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 tokenize an attribute just for a specific server.
1037
+
To define a list of one or more names for a specific MBean in the injector directive hierarchy, format the list as follows:
1038
+
```
1039
+
MBean[comma separated list of names]
1040
+
``
1041
+
For instance, to select only the admin server named AdminServer for a Server directive, use the format Server[AdminServer]. To select servers soa_server1 and soa_server2 from the model, the injector key use the format Server[soa_server1,soa_server2]
1047
1042
1048
1043
The injector tool recognizes two KEYWORDS for a user list, MANAGED_SERVERS (all the managed servers in the model) and ADMIN_SERVER (The admin server in the model).
1049
1044
1050
-
A custom injector to parameterize the admin server SSL listen port is:
1045
+
A custom injector for the admin server SSL listen port is:
0 commit comments