Assets
represent application binaries that contain business logic that runs
on the target runtime environment and serves client requests. An asset
can contain an archive of files such as a compressed (zip) or Java™ archive (JAR) file, or an archive of archive
files such as a Java Platform, Enterprise Edition (Java EE) enterprise
archive (EAR) file. Examples of assets include EAR files, shared library
JAR files, and custom advisors for proxy servers.
Use the importAsset command
to import assets to the application server configuration repository.
See the documentation for the BLAManagement command group for the
AdminTask object for additional parameter and step options.
For
this example, the commands add three assets to the asset repository.
Two of the assets are non-Java EE assets and one is an enterprise
asset. The following command imports the asset1.zip asset
to the asset repository and sets the returned configuration ID to
the asset1
variable:
asset1 = AdminTask.importAsset('-source c:/ears/asset1.zip')
asset1 = AdminTask.importAsset('-source /ears/asset1.zip')
The
following command imports the asset2.zip asset
metadata only, sets the asset name as testAsset.zip,
sets the deployment directory, specifies that the asset is used for
testing, and sets the returned configuration ID to the testasset
variable:
testasset = AdminTask.importAsset('-source c:/ears/asset2.zip -storageType METADATA
-AssetOptions [[.* testAsset.zip .* "asset for testing"
c:/installedAssets/testAsset.zip/BASE/testAsset.zip "" "" "" false]]')
testasset = AdminTask.importAsset('-source /ears/asset2.zip -storageType METADATA
-AssetOptions [[.* testAsset.zip .* "asset for testing"
/installedAssets/testAsset.zip/BASE/testAsset.zip "" "" "" false]]')
The
following command imports the defaultapp.ear asset,
storing all application binaries, and sets the returned configuration
ID to the J2EEAsset
variable:
J2EEAsset = AdminTask.importAsset('-source c:/ears/defaultapplication.ear
-storageType FULL -AssetOptions [[.* defaultapp.ear .* "desc" "" "" "" "" false]]')
J2EEAsset = AdminTask.importAsset('-source /ears/defaultapplication.ear
-storageType FULL -AssetOptions [[.* defaultapp.ear .* "desc" "" "" "" "" false]]')
The assets of interest are registered as named configuration
artifacts in the application server configuration repository, which
is referred to as the asset registry. Use the
listAssets command
to display a list of registered assets and verify that the settings
are correct, as the following example demonstrates:
AdminTask.listAssets('-includeDescription true -includeDeplUnit true')