|
|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TOP THREE LINKS YOU MUST CLICK ON WebLogic Server
Server Configuration
Tasks may be made easier with WLST
By: Satya Ghattu
Digg This!
WebLogic Server Scripting Tool (WLST) is a command-line scripting tool that BEA intends to support as part of the WebLogic Server 9.0 release. This tool is available today on BEA Systems' dev2dev Web site and works with BEA WebLogic Server versions 7.0 and 8.1, including all service packs. BackgroundThere has always been a need for WebLogic Server to support a scripting solution that allows developers and system administrators to perform both simple and complex changes to their WebLogic Server configuration reliably and interactively. Currently, WebLogic Server supports three command-line tools that require a running WebLogic Server instance: weblogic.Admin, weblogic.Deployer, and the WLConfig Ant task tool. Weblogic.Admin and WLConfig are used to make configuration changes and interrogate MBeans, whereas weblogic.Deployer is used strictly for application deployment. There are also other non-supported tools with which users are familiar such as WLShell, Config2Admin, and MBeanExplorer, etc.There are many use cases where a simple scripting tool would be handy. For example, developers and administrators may need to write scripts to configure a server and want to enhance it with additional configuration elements via loops and other flow-control constructs. A use case like this would propel the need for a scripting language interpreter that can read user scripts and then run them against the WebLogic Server. WLST makes an attempt to solve some of the challenges that our current WebLogic Server developers and administrators face. These include capturing repeatable configurations primarily aimed at the preparation of an environment (applications and dependencies) as part of a larger, deployment action; sharing complex configuration changes between users at one level of the life cycle or between levels (e.g., between development and staging); and applying the same change, iteratively, across multiple nodes of a topology, or at some other scope. Adding support for user-defined scripting to WebLogic Server greatly enhances the usability, resulting in higher user satisfaction. With WLST, users are able to customize WebLogic Server to suit their needs, ease their routine tasks, and extend added functionality. Repetitive tasks and complex procedures can now be simplified by providing scripts to handle them. With the help of scripts, components can be "glued" together to form applications. The scripting language augments the Java language and supports the accelerated development. IntroductionThe WebLogic Server Scripting Tool is a command-line scripting interface for WebLogic Server. The WLST scripting environment is based on the Java scripting interpreter, Jython. WLST lets you make use of the provided WebLogic Server scripting functions as well as common features of interpreted languages. These include local variables, conditional variables, and flow control statements. WebLogic Server developers and administrators can extend the WebLogic Server scripting language to suit their environmental needs by following the Jython language syntax.Jython is an implementation of the high-level, dynamic, object-oriented language Python seamlessly integrated with the Java platform. Jython is 100% Pure Java and is easy to learn with a clear and simple syntax. One of the main advantages of Jython is that you can call any Java object from within the Jython interpreter. What this means for a user is that he/she can reuse any Java code or Java tools that he/she had written. I won't delve too much into details about Jython for this article. For more information about Jython, check out www.jython.org. WLST FlavorsWLST comes in two flavors, offline and online. Offline is used when a user isn't connected to any WebLogic Server instance and is configuring the domain by interacting with the domain file and configuration templates. This functionality is similar to the Configuration Wizard silent mode scripting that is being deprecated in WebLogic Server version 9.0. Online WLST is utilized when a user is connected to a running WebLogic Server instance and makes changes to the configuration artifacts or monitors the runtime data. Today, both online and offline WLST are available as two separate downloadable JARs. For WebLogic Server version 9.0, the functionality of online and offline WLST will be folded into one tool.Modes of OperationWLST provides three modes of operation: interactive, script, and embedded modes. In the interactive mode, the users enter commands and view the response on a command-line prompt. This mode is useful for learning the scripting tool and its capabilities. It is also useful for prototyping command syntax to verify the options before building a larger script. An example of an interactive session is shown in Listing 1. Script mode lets the user supply a set of script commands in a file that the tool executes as a program. Listing 2 shows a simple script that can be executed as a program on WLST. Embedded mode is where a user embeds the WLSTInterpreter in a Java application (see Listing 3).FeaturesWebLogic Server implements the Java Management Extensions (JMX) 1.0 and all subsystems (JMS, JDBC, Security, etc.) are instrumented as MBeans and contain attributes by which they can be configured, monitored, and managed. All of these MBeans are arranged in a hierarchical fashion with the DomainMBean as the parent to all of the Configuration MBeans and the DomainRuntimeMBean as the parent to all of the Runtime MBeans. A user can navigate to all of the MBeans via WLST by invoking different WLST commands. For simplicity, the navigation is loosely based upon the file notation in any operating system.Navigation Configuration Current Managed Object (cmo) Java from WLST Invoking WLST from Ant Extend WLST Commands WLST Module WLST in ActionLet's work through a simple use case that demonstrates an end-to-end scenario where WLST fits in naturally. Consider an administrator trying to configure a domain for his developers. Essentially, he would like to create a domain (one admin server) from scratch, start the server, configure managed servers, and cluster and deploy applications. He would also like to monitor the health of these servers via a simple script. The steps involved here are:
Looking ForwardWLST is available today on BEA Systems' dev2dev site. This version of the tool works with WebLogic Server versions 7.0 and 8.1, including all service packs. Support for this tool is provided via the BEA Systems' Management Newsgroups. It will be officially available and supported in WebLogic Server version 9.0, slated for release sometime next year. BEA Systems is also considering retroactive support for WLST for WebLogic Server versions 7.0 and 8.1.Some of the new features in WLST that you can expect to see are:
SummaryIn this article, I introduced a new tool, the WebLogic Scripting Tool (WLST), that will empower developers and system administrators to conveniently interact with WebLogic Server (both offline and online) and be able to perform actions that achieve configuration changes to WebLogic Server. WLST can be used in an interactive mode, script mode, or in an embedded mode. It provides a generic and simple access to MBeans in WebLogic Server and also defines convenient commands that can be used to monitor the life cycle of a WebLogic Server instance. WLST is built on Jython, which is a 100% Pure Java implementation of the popular Python language.ReferencesBEA WEBLOGIC LATEST STORIES
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING NEWS FROM THE WIRES
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||