Skip to content

Commit e6b3f27

Browse files
Improve readme
1 parent 7e17a33 commit e6b3f27

File tree

1 file changed

+28
-33
lines changed

1 file changed

+28
-33
lines changed

README.md

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -847,13 +847,13 @@ When creating the archive, the tool will try to gather all binaries, scripts, an
847847

848848
## The Variable Injector Tool
849849

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.
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 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.
853853

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.
855855

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.
857857

858858
The supported keywords are as follows:
859859

@@ -932,37 +932,26 @@ Server.soa_server2.ListenPort=8001
932932
Server.soa_server2.SSL.ListenPort=8002
933933
```
934934

935-
To designate the name and location of the variable properties file, include the variable_file_name directive in the model_variable_injector.json file.
936-
937-
```json
938-
{
939-
"variable_file_name": "/home/savedomain/variables.properties",
940-
}
941-
```
942-
943-
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
945937
and location will be used.
946938

947939
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.
948940

949941
### Custom Variable Injector
950942

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.
953944

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.
958946

959947
```json
960948
{
961949
"Server.SSL.ListenPort": {},
962950
}
963951
```
964952

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+
966955
```yaml
967956
topology:
968957
Server:
@@ -975,29 +964,28 @@ topology:
975964
ListenPort: 7002
976965
```
977966
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.
979968
980969
#### Custom special directives
981970
982971
The following directives can refine the variable injection.
983972
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
986975
model is the weblogic default value.
987976
988977
- variable_value:
989978
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.
990979
991980
- regexp:
992981
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 .
994983
-- pattern:
995984
the regular expression pattern to apply to the string value or map values of an attribute
996985
-- 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
998987
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.
1001989
1002990
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
1003991
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:
10301018
},
10311019
```
10321020

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:
10341022

10351023
```
10361024
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)))'
1025+
```
10371026

1027+
And The variables put in the properties file:
1028+
1029+
```
10381030
JDBCSystemResource.Database1.JdbcResource.JDBCDriverParams.URL--Host=slc05til.us.oracle.com
10391031
JDBCSystemResource.Database1.JdbcResource.JDBCDriverParams.URL--Port=1521
10401032
```
10411033

10421034
#### Selecting specific MBean names for variable injection
10431035

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]
10471042
10481043
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).
10491044
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:
10511046
10521047
```json
10531048
{

0 commit comments

Comments
 (0)