Example: Configuring applications for enterprise bean modules using the wsadmin tool
Use the AdminApp object to set configurations in an application. Some configuration settings are not available through the AdminApp object. This example uses the AdminConfig object to configure enterprise bean modules for all the JARs in the application.
- Get the deployment object for the application and assign it to the deployments variable:
set deployments [$AdminConfig getid /Deployment:myApp/]Example output:
myApp(cells/mycell/applications/myApp.ear/deployments/myApp:deployment.xml#Deployment_1)
- Get all the modules in the application and assign it to the modules variable:
set deploymentObject [$AdminConfig showAttribute $deployments deployedObject] set modules [lindex [$AdminConfig showAttribute $deploymentObject modules] 0]Example output:
(cells/mycell/applications/myApp.ear/deployments/myApp:deployment.xml#WebModuleDeployment_1) (cells/mycell/applications/myApp.ear/deployments/myApp:deployment.xml#EJBModuleDeployment_1) (cells/mycell/applications/myApp.ear/deployments/myApp:deployment.xml#EJBModuleDeployment_2)- Create an enterprise bean module configuration object for each JAR and set the timeout attribute:
foreach module $modules { if ([regexp EJBModuleDeployment $module] == 1} { $AdminConfig create EJBModuleConfiguration $module {{name myejbModuleConfig} {description "EJB Module Config post created"} {enterpriseBeanConfigs:StatefulSessionBeanConfig {{{ejbName myejb} {timeout 10000}}}}} } }You can modify this example to set other attributes for the enterprise bean module configuration.Example output:
myejbModuleConfig(cells/mycell/applications/myApp.ear/deployments/myApp:deployment.xml#EJBModuleConfiguration_1)- Save the changes with the following command:
$AdminConfig save