Adding an EBA asset to a business-level application using the addCompUnit command

Use the addCompUnit command to add an enterprise bundle application (EBA) composition unit that consists of a previously-imported EBA asset plus configuration information. Configuration information includes the context roots, virtual hosts, security role mappings, and web module or Blueprint resource bindings for your OSGi application.

Before you begin

You can add an EBA asset to a business-level application by using the addCompUnit command as described in this topic, or by using the administrative console as described in Adding an EBA asset to a business-level application using the administrative console.

An EBA asset can be added to only one business-level application. A business-level application is scoped to cell scope, so this means that only one instance of a given OSGi application can be deployed in a cell.

This task makes the following assumptions:
  • You have already imported the EBA file as an asset (for example by using the importAsset command as described in step 2 of Setting up business-level applications using wsadmin scripting), then saved your changes to the master configuration (which causes any bundle dependencies to be downloaded from configured bundle repositories).
  • You have already defined the target virtual hosts. To check existing virtual hosts using the wsadmin tool, issue the following jython command:
    print AdminConfig.list('VirtualHost')
  • You have already created the JCA authentication alias that you want to associate with each Blueprint resource reference.

About this task

An EBA composition unit consists of a previously-imported EBA asset, plus some or all of the following configuration information:
  • Mappings from the composition unit to a target application server, web server or cluster.
  • Configuration of the application's context roots or virtual hosts.
  • Bindings to any associated web modules or blueprint resource references.
  • Mappings from security roles to particular users or groups.

This topic includes a brief description of the main elements that you need to configure when adding an EBA asset. For a more complete description of the addCompUnit command and its parameters, see Managing composition units using wsadmin scripting and BLAManagement command group for the AdminTask object using wsadmin scripting.

For clarity, each of the following steps describes the syntax for adding a single element to the EBA composition unit. However, to create the composition unit you run the addCompUnit command only once. Therefore, when you run the command, you must combine these elements together. An example of the combined syntax is given after the separate steps.

You specify the configuration information for the EBA asset during the following procedure and you cannot change it later. For example, if you subsequently update a bundle in an EBA asset, you cannot introduce anything that requires additional configuration, for example new resource references.

Procedure

Example

In the following example, the jython syntax from the previous individual steps is combined so that, by running the addCompUnit command once only, an EBA composition unit is created and added to a business-level application:
AdminTask.addCompUnit('[
  -blaID WebSphere:blaname=helloWorldService 
  -cuSourceID WebSphere:assetname=com.ibm.ws.eba.helloWorldService.eba
  -CUOptions [
    [WebSphere:blaname=helloWorldService.eba 
    WebSphere:assetname=com.ibm.ws.eba.helloWorldService.eba 
    com.ibm.ws.eba.helloWorldService_0001.eba "" 1 false DEFAULT]] 
  -MapTargets [[ebaDeploymentUnit WebSphere:cluster=cluster1]] 
  -ActivationPlanOptions [[default ""]]  
  -ContextRootStep [
    [com.ibm.ws.eba.helloWorldService.web 1.0.0 "/hello/web"] 
    [com.ibm.ws.eba.helloWorldService.withContextRoot 0.9.0 "/hello/service"]]
  -VirtualHostMappingStep [
    [com.ibm.ws.eba.helloWorldService.web 1.0.0 
    "HelloWorld service" default_host]
    [com.ibm.ws.eba.helloWorldService.withContextRoot 0.9.0 
    "HelloWorld second service" test_host]]
  -MapRolesToUsersStep [
    [ROLE1 No Yes "" ""] 
    [ROLE2 No No WABTestUser1 ""] 
    [ROLE3 No No "" WABTestGroup1] 
    [ROLE4 Yes No "" ""]]
  -BlueprintResourceRefBindingStep[
    [com.ibm.ws.eba.helloWorldService.properties.bundle 1.0.0 resourceRef 
    javax.sql.DataSource jdbc/Account 
    Container Shareable alias1]]
  -WebModuleResourceRefs [
    [com.ibm.ws.eba.helloWorldService.web 1.0.0 jdbc/jtaDs javax.sql.DataSource 
    jdbc/helloDs "" "" ""] 
    [com.ibm.ws.eba.helloWorldService.web 1.0.0 jdbc/nonJtaDs javax.sql.DataSource 
    jdbc/helloDsNonJta "" "" "extprop1=extval1"]]
]')

What to do next

After using the command, save your changes to the master configuration by using the following command:

AdminConfig.save()

You are now ready to start your business-level application.


Icon that indicates the topic type Task topic

Terms and conditions for information centers | Feedback


Timestamp icon Last updated: Saturday, 20 October 2012
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v700osgijpa&product=was-nd-mp&topic=thread_ta_dev_acu_wsadmin

Copyright IBM Corporation 2009, 2012.
This information center is powered by Eclipse technology. (http://www.eclipse.org)