Adobe 38000382 JRun Guide

Adobe 38000382 - Macromedia JRun - Mac Manual

Adobe 38000382 manual content summary:

  • Adobe 38000382 | JRun Guide - Page 1
    JRun SDK Guide
  • Adobe 38000382 | JRun Guide - Page 2
    M Logo & Design, Macromedia Flash, Macromedia Xres, Macromind, Macromind If you access a third-party website mentioned in this guide, then you do so at your own risk. Macromedia 1999-2002 Macromedia, Inc. All rights reserved. This manual may not be copied, photocopied, reproduced, translated,
  • Adobe 38000382 | JRun Guide - Page 3
    CONTENTS ABOUT THIS BOOK VII Developer resources viii About JRun documentation ix Printed and online documentation set ix Accessing online documentation ix Other resources x Contacting Macromedia xiii CHAPTER 1 Introduction to the SDK 1 About the JRun SDK 2 Getting the SDK 2 SDK/retail
  • Adobe 38000382 | JRun Guide - Page 4
    Library 47 Extracting the JMC custom tag library 48 Strategies for working with the JMC custom tags 49 Finding services, classes, and methods 49 Using the service and server attributes 49 Using the mbean attribute 50 Understanding offline properties 50 Using the errorId attribute 51 Using
  • Adobe 38000382 | JRun Guide - Page 5
    WSDL2Java 75 JRun executables 77 CHAPTER 8 JRun Services 79 Service architecture (JMX 80 Creating services 82 Basic JRun services: extending ServiceMBean and ServiceAdapter 82 Service naming convention 82 Service composition: extending ServicePartitionMBean and ServicePartition 82 Creating
  • Adobe 38000382 | JRun Guide - Page 6
    Adding JRun service security 92 Loading MBeans through MLETs 93 CHAPTER 9 Editing XML Files 95 Editing XML files 96 Tools for editing XML files 97 Understanding the XML
  • Adobe 38000382 | JRun Guide - Page 7
    The JRun SDK Guide is for OEMs and advanced users of Macromedia JRun. This book assumes that you are comfortable using JRun and understand the XML configuration files. This chapter tells you how to access JRun and Macromedia resources, such as websites, documentation, and technical support. Contents
  • Adobe 38000382 | JRun Guide - Page 8
    Developer resources Macromedia, Inc. is committed to setting the standard for customer support in developer education, documentation, technical support, and professional services. The Macromedia website is designed to give you quick access to the entire range of online resources. The following table
  • Adobe 38000382 | JRun Guide - Page 9
    documentation provides support for all services. JRun Assembly and Deployment Describes how to assemble and deploy the Guide components of a J2EE application. JRun SDK Guide versions of all JRun books as Adobe Acrobat Portable Document Format (PDF) files. The PDF files are included on the JRun
  • Adobe 38000382 | JRun Guide - Page 10
    0130893404 Java Servlet Programming, Second Edition Jason Hunter and William Crawford O'Reilly & Associates, 2001 ISBN: 0596000405 Java Servlets Developer's Guide Karl Moss McGraw-Hill/Osborne Media, 2002 ISBN: 0-07-222262-X Inside Servlets: Server-Side Programming for the Java Platform, Second
  • Adobe 38000382 | JRun Guide - Page 11
    : 193011009X Core JSP Damon Hougland and Aaron Tavistock Prentice Hall, 2000 ISBN: 0130882488 JSP: JavaServer Pages (Developer's Barry Burd Guide) Hungry Minds Inc., 2001 ISBN: 0764535358 Enterprise JavaBeans Mastering Enterprise JavaBeans, Second Edition Ed Roman John Wiley & Sons, 2002
  • Adobe 38000382 | JRun Guide - Page 12
    /j2ee/ download.html#blueprints) Building Java Enterprise Systems with J2EE Paul Perrone and Venkata S.R. "Krishna" .R. Chaganti Sams, 2000 ISBN: 0672317958 J2EE: A Bird's Eye View (e-book) Rick Grehan Fawcette Technical Publications, 2001 ISBN: B00005BAZV Java Message Service Richard Monson
  • Adobe 38000382 | JRun Guide - Page 13
    www.macromedia.com Macromedia offers a range of telephone and web-based support options. Go to http://www.macromedia.com/support/ for a complete description of technical support services. You can make postings to the JRun Support Forum (http://webforums.macromedia.com) at any time. Toll Free: 888
  • Adobe 38000382 | JRun Guide - Page 14
    xiv About This Book
  • Adobe 38000382 | JRun Guide - Page 15
    CHAPTER 1 Introduction to the SDK The JRun Software Development Kit (SDK) contains source code, Javadocs, and utilities for customizing the Macromedia JRun installation. It is primarily intended for OEMs, ISVs, and advanced JRun users. Contents • About the JRun SDK 2 • Software requirements 3 •
  • Adobe 38000382 | JRun Guide - Page 16
    JRun OEM kit. Getting the SDK You can download the JRun SDK from the Macromedia website. To download the SDK: 1 Download the latest version of the JRun SDK from modules: − JRun Management Console (JMC) − Connectors − Windows service − Launcher − JAAS Windows login module − OpenSSL toolkit The SDK
  • Adobe 38000382 | JRun Guide - Page 17
    Software requirements You can use the SDK to compile your own custom connectors, recompile the JMC with custom functions, or compile your own JRun installer. Depending on what your purpose is, the SDK has various requirements. The following table describes the tools that you might need while
  • Adobe 38000382 | JRun Guide - Page 18
    Includes all files used by the default JRun server, including the default application. flashgateway Contains the files necessary to run the Macromedia Flash Remoting service that is installed in the retail version of JRun by default. jmc Includes the files used by the JMC applications. The JMC
  • Adobe 38000382 | JRun Guide - Page 19
    contains filesets for all JRun components. It also contains subdirectories for each supported platform with a binary code base for each of the following JRun tools: • JRun EJB Deployment Wizard • Web Services • Web Server Configuration tool The subdirectories contain the compiled classes and
  • Adobe 38000382 | JRun Guide - Page 20
    /src directory of the SDK: Subdirectory C Connectors JMC Description Contains the source code for the following JRun components: • Launcher • Windows services • JAAS Windows login module Contains the source code for web server connectors for the following web servers: • Apache • IIS (including
  • Adobe 38000382 | JRun Guide - Page 21
    SDK documentation The docs directory contains this SDK Guide and JRun API Javadocs for the jrunx.jmc packages. The Javadocs for these packages are not included in the retail installation of JRun. Release notes
  • Adobe 38000382 | JRun Guide - Page 22
    8 Chapter 1 Introduction to the SDK
  • Adobe 38000382 | JRun Guide - Page 23
    provides an overview of building installers in JRun for Windows and UNIX platforms. For advanced JRun users, it also includes instructions on how to customize your installation of JRun. Contents • Installer overview 10 • Configuring JRun during installation 11 • Building a customized version
  • Adobe 38000382 | JRun Guide - Page 24
    Installer overview The files included in the JRun SDK for building custom installations are physically separated by functionality. In this book, each functional group is referred to as a module. Based on your license agreement, you can access some or all of these modules. JRun provides several sets
  • Adobe 38000382 | JRun Guide - Page 25
    Configuring JRun during installation This section describes common techniques that you might use when building either Windows or UNIX custom installers. Custom software requirements Users must have a JRE version 1.3.0 or later, and their system PATH environment variable must include the bin
  • Adobe 38000382 | JRun Guide - Page 26
    (); openport = gcp.scan(portrange); ArrayList args = new ArrayList(); args.add("-i"); args.add(xmlinfile); args.add("-s"); args.add("//service[@name=\"WebService\"]/attribute[@name=\"port\"]/text()"); args.add(openport); String[] scriptArgs = new String[args.size()]; args.toArray(scriptArgs); try
  • Adobe 38000382 | JRun Guide - Page 27
    on page 72. For more information using XMLScript, see JRun Programmer's Guide. Setting the JMC username and password The JMC requires a username and process. You can hardwire the username and password for the JMC and then instruct your user to use that combination to log in to the JMC. To
  • Adobe 38000382 | JRun Guide - Page 28
    Building a customized version of JRun The standard JRun installation gives you some control over which components you can include, however, the SDK includes filesets and the build.txt file so that you can have much finer-grained control over your own installation. The following sections describe how
  • Adobe 38000382 | JRun Guide - Page 29
    Setting the language The SDK includes the following directories for creating custom localized JRun installations: • sdk_root/filesets/english • sdk_root/filesets/french • sdk_root/filesets/japanese These directories include localized versions of JRun files. You can set the language using the Ant
  • Adobe 38000382 | JRun Guide - Page 30
    16 Chapter 2 JRun Installer Overview
  • Adobe 38000382 | JRun Guide - Page 31
    CHAPTER 3 Windows JRun Installers This chapter focuses on preparing a customized installation image of Macromedia JRun for OEM customers using a Microsoft Windows Installer development environment. Contents • Overview of Windows installations 18 • Customizing JRun installers with Windows Installer
  • Adobe 38000382 | JRun Guide - Page 32
    Overview of Windows installations The JRun SDK includes merge modules that correspond to functional components in JRun. You can easily customize these modules, and add or remove them from installers on the Windows platform. When creating custom installers for the Windows platform, you have two
  • Adobe 38000382 | JRun Guide - Page 33
    environment, see "Using the Windows Installer wrapper" on page 25. Customizing JRun installers with Windows Installer The JRun SDK natively supports Windows Installer development environments by including the JRun core components as merge modules. This section describes these merge modules and how
  • Adobe 38000382 | JRun Guide - Page 34
    services JRun4WebServices.msm (Optional) Includes all files used to implement Web Services on JRun. Documentation JRun4Docs.msm (Optional) Includes the PDF of XDoclet. Flash gateway JRun4FlashGateway.msm (Optional) Includes the Macromedia Flash Remoting service. Web Server JRun4Conn
  • Adobe 38000382 | JRun Guide - Page 35
    Working with InstallShield Developer 7 To work with the OEM version of JRun for the Windows Installer development environment, you copy the merge modules into your defined Merge Module folder, and link the merge modules into your install. Note: The JRun Core merge module is the minimum that is
  • Adobe 38000382 | JRun Guide - Page 36
    Connecting a merge module You connect a merge module to existing Features within the InstallShield project. In order to map the modules to the Features, you must perform the following tasks: • Create the Features. • Connect the Features to the merge modules. • Set the default destinations for each
  • Adobe 38000382 | JRun Guide - Page 37
    To connect the merge module to the new feature: 1 Select Specify Application Data > Merge Modules. InstallShield displays the available merge modules in the center pane, as the following figure shows: 2 Select the Feature that you want to connect. 3 Right- click the merge module that you want to
  • Adobe 38000382 | JRun Guide - Page 38
    such as InstallShield and Wise Solutions, you can use the Windows Installer service from the command line to create an installer from merge modules. You Installer package file. product_code is the globally unique identifier (GUID) of the Windows Installer package. options are msiexec options for
  • Adobe 38000382 | JRun Guide - Page 39
    Using the Windows Installer wrapper The Windows Installer wrapper has a graphical interface, however, its primary use is to run the Windows installation unattended. Run the Windows Installer wrapper, using the following command line syntax: setup.exe /s /v"/qn INSTALLDIR=" The
  • Adobe 38000382 | JRun Guide - Page 40
    26 Chapter 3 Windows JRun Installers
  • Adobe 38000382 | JRun Guide - Page 41
    CHAPTER 4 Platform-Independent JRun Installers This chapter focuses on preparing a customized installation image of Macromedia JRun 4 for OEM customers who are using any platform. Contents • About files for custom installations 28 • Using BIN files...28 27
  • Adobe 38000382 | JRun Guide - Page 42
    for custom installations The JRun SDK includes the following groups of files that you can use to create custom JRun installers on any supported platform: • BIN files Prebuilt binary files that you can use across platforms, separated into functional components. • filesets Raw filesets of the JRun
  • Adobe 38000382 | JRun Guide - Page 43
    Flash gateway JRun4FlashGateway.bin Web Server JRun4Conn.bin Configuration Tool Description (Optional) Includes all files used to implement web services on JRun. (Optional) Includes the PDF documentation that is available for download at http://www.installanywhere.com. Using BIN files 29
  • Adobe 38000382 | JRun Guide - Page 44
    30 Chapter 4 Platform-Independent JRun Installers
  • Adobe 38000382 | JRun Guide - Page 45
    CHAPTER 5 Embedding JRun This chapter is intended for OEM customers who want to run their applications on top of the JRun application server and hide JRun from their customers. It includes techniques for adding functionality that transparently modifies the JRun server environment. Contents •
  • Adobe 38000382 | JRun Guide - Page 46
    to be: • GUI Rebrand the GUI version of the Web Server Configuration tool so that it appears to be part of your application suite. For instructions on changing the look and feel of the GUI, see "Rebranding the Web Server Configuration tool" on page 37. • Command line Invoke the Web Server
  • Adobe 38000382 | JRun Guide - Page 47
    Including the Web Server Configuration tool in the installer To set up the Web Server Configuration tool to configure the connection without requiring your users to run it, you can supply its settings and run it from the command line during the installation process. You can insert the following
  • Adobe 38000382 | JRun Guide - Page 48
    effect the next time you start the JRun server. If you disable JSP compilation but your application includes JSPs, you must precompile them using the instructions in the section, "Precompiling JSPs" on page 35. 34 Chapter 5 Embedding JRun
  • Adobe 38000382 | JRun Guide - Page 49
    a corresponding class file. The drawback to this method is that you must manually request each JSP page. Omitting a single JSP page causes an error if same default applications on them. For example, the Macromedia Flash Remoting service is deployed on both the default JRun server and the samples
  • Adobe 38000382 | JRun Guide - Page 50
    samples Flash Remoting Samples samples SmarTicket samples Techniques samples TravelNet samples Web Services samples the JMC but hide it from users, make it available for remote or on-site support personnel, and use other JRun and Java tools for editing the JRun configuration files. You
  • Adobe 38000382 | JRun Guide - Page 51
    your application suite. The SDK provides source code for the following tools: • JRun Management Console (JMC) • Web server connectors • Windows service • JRun Launcher • JAAS Windows login module • OpenSSL toolkit For more information about source code, see "JRun source code" on page 6. Rebranding
  • Adobe 38000382 | JRun Guide - Page 52
    Replacing images The wsconfig.jar executable JAR file contains images used in the Web Server Configuration tool. The images are located in the /jrunx/connectorinstaller/gui/resources directory. The tool reads in these images at runtime. When you change the images, they appear the next time that you
  • Adobe 38000382 | JRun Guide - Page 53
    Replacing text The wsconfig.jar executable JAR file contains text files that are used in the Web Server Configuration tool. The text files are located in the /jrunx/connectorinstaller/gui directory. Each resource bundle provides the text for the tool in one language. The following table describes
  • Adobe 38000382 | JRun Guide - Page 54
    Rebranding the JRun Launcher Retail JRun customers use the JRun Launcher to start, stop, and restart JRun servers. As an OEM, you can rebrand the tool to make it look like it is part of the customer's application suite. To rebrand the JRun Launcher: 1 Stop all JRun servers and JRun utilities. 2
  • Adobe 38000382 | JRun Guide - Page 55
    Replacing text The jrun.jar executable JAR file contains text files used in the JRun Launcher. The text files are located in the /jrunx/launcher directory. To rebrand the JRun Launcher, change the values of the tokens in the properties file. The following table describes the tokens that you will
  • Adobe 38000382 | JRun Guide - Page 56
    . Compiling the JMC You can build the JMC with Ant by using the included build.xml file in the top-level JMC source directory. For instructions on installing and configuring Ant, see http://jakarta.apache.org/ant/. You can execute a simple compilation using the default settings by executing the ant
  • Adobe 38000382 | JRun Guide - Page 57
    The following table describes the targets in the top-level build.xml file of the JMC application: Target compile package l10n_extract l10n_clean l10n_genjsp javadoc clean clean-build-area Description Compiles the JMC application with an open directory structure. The open directory must be in the
  • Adobe 38000382 | JRun Guide - Page 58
    troubleshooting. You can include the JMC, and then disable the admin JRun server, so that you (or your field technical support) ...
  • Adobe 38000382 | JRun Guide - Page 59
    Using exit handlers JRun lets you control the way your application behaves if it is running in the same virtual machine (VM) as JRun when JRun exits. You can use a custom exit handler to provide your own error messages or clean up files in the event of an unplanned exit or fatal error. By default,
  • Adobe 38000382 | JRun Guide - Page 60
    Exit codes The following exit codes are valid: • Launcher.RESTART_EXIT • Launcher.FATAL_ERROR_EXIT The normal execution of JRun commands (other than restart and status) do not produce an exit code or call the exit handler. 46 Chapter 5 Embedding JRun
  • Adobe 38000382 | JRun Guide - Page 61
    CHAPTER 6 Using the JMC Custom Tag Library The JMC uses its own custom tag library that provides access to JRun services. You can access this tag library and build JSPs that control the JRun environment. This chapter describes how to access the JMC custom tag library,
  • Adobe 38000382 | JRun Guide - Page 62
    Extracting the JMC custom tag library The JMC tag library is part of the JMC application, stored as jmc-app.ear in the admin JRun server's root directory. JRun automatically deploys this application when you start the admin server. In order to use the tag library, you must put a copy of it in your
  • Adobe 38000382 | JRun Guide - Page 63
    . You can use the HtmlAgentService to determine services availability, and which attributes of those services are writable. For more information on the HtmlAgentService, see JRun Administrator's Guide. • jrun.xml file Read the jrun.xml file to see services and their attributes that are defined for
  • Adobe 38000382 | JRun Guide - Page 64
    you make a change with the offline tag, the change propagates the next time the server is restarted. Offline custom tags can take the server and service attribute combination. If the server attribute is not specified, JRun invokes the tag on the JRun server on which the tag's JSP is running. You
  • Adobe 38000382 | JRun Guide - Page 65
    example sets the id of the return value from the getProperty tag to port and then prints the value of port: Port: By default, the id attribute specifies a variable of type String. If you specify a type attribute
  • Adobe 38000382 | JRun Guide - Page 66
    converts parameters to Strings using the toString method. cluster=X server=Y Adds server Y to cluster X. JRun stores the cluster's settings in the ClusterManager service definition in the jmc.xml file. cluster=X Registers cluster X in the jmc.xml file. You can optionally add servers at the same
  • Adobe 38000382 | JRun Guide - Page 67
    Attribute server=X Description Adds server X using the following parameters set in the parameter tag: • servername (Optional.) Registers a JRun server under a different name than the server property. Only used for remote JRun servers. • host Specify "localhost" or a remote machine or hostname. •
  • Adobe 38000382 | JRun Guide - Page 68
    is similar to setOfflineProperty tag. This tag is often used when adding properties for the DeployerService. Attributes Attribute Description service (Required.) The name of the service. server The name of the JRun server. Defaults to the server on which the JSP is invoked. name Required
  • Adobe 38000382 | JRun Guide - Page 69
    Example The following example detects if the samples server exists and then lists any read-only files or directories in the samples directory: ...
  • Adobe 38000382 | JRun Guide - Page 70
    attributes, the getOfflineProperty tag reads the property from the jrun.xml file. For details on how to specify a server and service path, see "Using the service and server attributes" on page 49. Example The following example prints the values of the samples JRun server's Context.PROVIDER_URL
  • Adobe 38000382 | JRun Guide - Page 71
    on which the JSP is invoked. Usage The following table describes the attributes you use to determine the target object:. Attribute mbean dataSource service rar Description Returns the named property of the specified MBean. Returns the named property of the specified data source (the name of the
  • Adobe 38000382 | JRun Guide - Page 72
    example gets the Port property of the WebService MBean on the current JRun server: ... Port: ... getServer Description Returns a jrunx.jmc.management.Server object. Attributes Attribute
  • Adobe 38000382 | JRun Guide - Page 73
    object. If only host is specified, then the JRunAdminService is accessed on the first running server detected on the host. If host is specified and service is specified, then the service is accessed on the first running server detected on the host. JMC custom tags reference 59
  • Adobe 38000382 | JRun Guide - Page 74
    Attribute useAdminServer method server Description Set to true in conjunction with specifying the server attribute to access the JRunAdminService on the first running server detected on the same host. Specifies the method to invoke on the specified server or host. If only server is specified and
  • Adobe 38000382 | JRun Guide - Page 75
    isRemoteServer Description Detects if the server is remote; if it matches the specified value, then JRun executes the body of the tag. Attributes Attribute name value Description (Required.) The name of the JRun server. (Required.) Set to true to detect if the server is remote. Set to false to
  • Adobe 38000382 | JRun Guide - Page 76
    value of the parameter as an argument to the addDeployDirectory method call: ... ... When using the invoke tag
  • Adobe 38000382 | JRun Guide - Page 77
    , which removes the server from the local machine. removeDirectory Set to true to remove the specified server's files and directories. Otherwise, the server service is disabled but the server's files and directories remain intact. server=X If the server is local, JRun removes the server from the
  • Adobe 38000382 | JRun Guide - Page 78
    Example The following example gets a list of available servers on the localhost and lets you delete one by selecting it from a drop-down list and clicking the Remove button: ...
  • Adobe 38000382 | JRun Guide - Page 79
    MBean. The name of the JRun server. The path of the JRun service. Example The following example gets LoggerService's format on the default JRun server and change it: ... Current
  • Adobe 38000382 | JRun Guide - Page 80
    ... status Description Indicates whether the specified server is running. Returns true if the specified server is running, or false if it is not, and conditionally executes the body of the tag. Attributes Attribute server availableId available
  • Adobe 38000382 | JRun Guide - Page 81
    CHAPTER 7 JRun APIs This chapter describes how to use the JRun API Javadocs and provides an overview of the public JRun classes and methods. It concludes with descriptions of the command-line tools available in JRun. Contents • Using the JRun API Javadocs 68 • JRun APIs overview 69 • Command-line
  • Adobe 38000382 | JRun Guide - Page 82
    the JRun Javadocs when working with the following: • Metadata classes, as described in Chapter 9, "Editing XML Files" on page 93. • Services, as described in Chapter 8, "JRun Services" on page 79. • JMC custom tags, as described in Chapter 6, "Using the JMC Custom Tag Library" on page 47. 68 Chapter
  • Adobe 38000382 | JRun Guide - Page 83
    that interact with the JSPC compiler and JSPs. Provides classes and interfaces that interact with the JRun Mail service. Provides classes and interfaces that interact with the JMS services in JRun. Provides access to the JRunNamingContext class. This class performs the brunt of the logic required by
  • Adobe 38000382 | JRun Guide - Page 84
    .migration jrunx.persistence jrunx.pool jrunx.resource jrunx.ri Description Provides access to the AxisService, which you use to implement web services. Provides access to the JRun clustering mechanism, including the ClusterManager. Provides access to classes and interfaces that use the SQL Invoker
  • Adobe 38000382 | JRun Guide - Page 85
    See Accessing MBean interfaces using custom tags Chapter 6, "Using the JMC Custom Tag Library" on page 47 Writing your own service and MBean interfaces Chapter 8, "JRun Services" on page 79. Accessing MBean interfaces using the JRun Administrator's Guide. HtmlAgentService JRun APIs overview 71
  • Adobe 38000382 | JRun Guide - Page 86
    and uses when administering JRun. This is especially important when adding new JRun servers. For more information about ports used by JRun, see JRun Administrator's Guide. 72 Chapter 7 JRun APIs
  • Adobe 38000382 | JRun Guide - Page 87
    Using the migration tool JRun provides a migration tool for moving JRun 3.x servers and configuration settings to JRun 4. Although you can deploy JRun 3.x J2EE modules in JRun 4 without using the migration tool, the tool exports many of the settings on which modules depend. You can invoke the
  • Adobe 38000382 | JRun Guide - Page 88
    the JRun Launcher. For more information on using the JRun command-line tool, see JRun Administrator's Guide. Using the jrunsvc tool Use the jrunsvc tool to execute command on a JRun server that is a Windows service. With this tool, you can install, remove, start, and stop the JRun server's Windows
  • Adobe 38000382 | JRun Guide - Page 89
    instructs JSPC to run in verbose mode. JSPC uses the IBM jikes compiler when it is in the jrun_root/bin directory; otherwise it uses the Sun javac compiler. For more information on using the JSPC command-line tool, see JRun Assembly and Deployment Guide for the web service. Java2WSDL is part
  • Adobe 38000382 | JRun Guide - Page 90
    ] For information about the Java2WSDL command-line options, see JRun Programmer's Guide. Using WSDL2Java The WSDL2Java tool generates web service proxy and skeleton code based on information in a web service WSDL document. WSDL2Java generates proxies from WSDL documents that specify RPC encoded
  • Adobe 38000382 | JRun Guide - Page 91
    .jar Yes xmlscript.jar No Description Starts the TCPMonitor utility. For more information on using the TCPMonitor utility with JRun, see JRun Programmer's Guide. The TCPMonitor is an open-source utility that is part of the Axis project. For source code and full TCPMonitor documentation, see http
  • Adobe 38000382 | JRun Guide - Page 92
    . For more information on using the java2wsdl utility, see "Using Java2WSDL" on page 75. No Generates web service proxy and skeleton code based on information in a web service WSDL document. For more information on using the wsdl2java utility, see "Using WSDL2Java" on page 76. No Migrates JRun
  • Adobe 38000382 | JRun Guide - Page 93
    CHAPTER 8 JRun Services This chapter provides an overview of the JRun service-based architecture and describes how to create a custom service. Contents • Service architecture (JMX 80 • Creating services ...82 • Accessing JRun services 89 • Adding JRun service security 91 • Loading MBeans through
  • Adobe 38000382 | JRun Guide - Page 94
    that are externalized as XML entries in jrun.xml are automatically created, initialized, and started, and their attributes are automatically configured. The services are automatically stopped and destroyed when the JRun server shuts down. You can invoke the start and stop methods any number of times
  • Adobe 38000382 | JRun Guide - Page 95
    The following figure shows the JRun service class architecture: Service architecture (JMX) 81
  • Adobe 38000382 | JRun Guide - Page 96
    . Any functionality described in such an interface is not exposed to JMX. • Implement the MBean interface Write a class that implements the service's MBean interface (or the optional functional interface, if one was created). Also implement any lifecycle methods (init, start, stop, destroy) that
  • Adobe 38000382 | JRun Guide - Page 97
    . EJB containers contain interceptors that handle functionality such as security, persistence, transactions, and so on. Each of these interceptors is a standard service, because they have no external meaning, they are not bound to the global default JMX domain. Instead, the container (since it
  • Adobe 38000382 | JRun Guide - Page 98
    props.put("foo", "foobar"); ServiceFactory.createService(this.server, "service=FooService","jrun.example.FooService", props); Creating the service manually Another programmatic method of creating such services is to manually create the service and subsequently register it with the underlying MBean
  • Adobe 38000382 | JRun Guide - Page 99
    example The following section describes steps and sample code to create a custom service that implements a custom log event handler. For more information on JRun logging, see JRun Administrator's Guide. To create a customized log event handler, you must perform the following steps: 1 Code an MBean
  • Adobe 38000382 | JRun Guide - Page 100
    XMLLogEventHandler extends LogEventHandler implements XMLLogEventHandlerMBean { protected String filename; protected SimpleDateFormat dateFormat = new SimpleDateFormat("MM/HH hh:mm:ss"); protected String defaultFormat = null; 86 Chapter 8 JRun Services
  • Adobe 38000382 | JRun Guide - Page 101
    + ""); out.println(" " + level + ""); out.println(" " + msg + ""); out.println(" " + exception + ""); out.println(""); } catch (Exception ex) { ex.printStackTrace(); Creating services 87
  • Adobe 38000382 | JRun Guide - Page 102
    attribute> # Created by JRun on {date MM/dd HH:mm:ss} 5000 {jrun.rootdir}/logs/{jrun.server.name}-event.xml
  • Adobe 38000382 | JRun Guide - Page 103
    's coupling to the JMX infrastructure and requires use of the JMX MBeanServer (see the JMX API). JNDI Services are not bound to JNDI by default, but can be automatically bound if the service's jrun.xml definition specifies a bindToJNDI attribute that is set to true, as the following example shows
  • Adobe 38000382 | JRun Guide - Page 104
    that extend jrunx.kernel.ServiceAdapter (including jrunx.kernel.ServicePartition), there are a series of convenience methods for accessing other running services, including the following methods: • Object lookup(String serviceName) use this method for performing a JNDI lookup in the JMX namespace
  • Adobe 38000382 | JRun Guide - Page 105
    the permission to jrun.jar using the jrun.policy file that is used at server startup. 3 Adding AccessController checks before the method body within the service method that you are protecting. If the calling code has permission to invoke the method, the method logic proceeds; if it does not, access
  • Adobe 38000382 | JRun Guide - Page 106
    lib/" NAME=":mbean=SampleMletService" > Hello World foobar For more information on the JMX HTMLAgent service, see JRun Administrator's Guide. For more information on JMX, see the Sun website. 92 Chapter 8 JRun
  • Adobe 38000382 | JRun Guide - Page 107
    CHAPTER 9 Editing XML Files This chapter describes how to use the XML metadata classes in the JRun API to manipulate the JRun configuration files. Contents • Editing XML files 94 • Understanding the XML metadata classes 96 • Using XML metadata 97 • Strategies ...98 • XML metadata example 99 93
  • Adobe 38000382 | JRun Guide - Page 108
    the underlying server technology. As an OEM, you or your support personnel, might need a way to access the application server as jrun.xml), you can add and remove services, and change the attributes of those services. You can also edit the J2EE XML files, Guide. 94 Chapter 9 Editing XML Files
  • Adobe 38000382 | JRun Guide - Page 109
    on page 75. • JMC custom tags The JMC custom tag lets you write JSP applications that control JRun services. For more information on using the JMC custom tags, see Chapter 6, "Using the JMC Custom Tag Library and processors that are included in JRun, see JRun Programmer's Guide. Editing XML files 95
  • Adobe 38000382 | JRun Guide - Page 110
    Understanding the XML metadata classes Each XML file has an XML metadata class equivalent. When you want to add, remove, or edit the elements of a particular XML file, you find what class instantiates that XML file and then execute the available methods on that class to edit the file. For example,
  • Adobe 38000382 | JRun Guide - Page 111
    Using XML metadata Follow these steps to edit the XML files. To edit XML files: 1 Find the appropriate class name. For web.xml, the JRunWebAppMetaData class instantiates this file. 2 Create a new class. If the file exists, you must execute the importXML(URL url) method on it. The URL is the file. If
  • Adobe 38000382 | JRun Guide - Page 112
    the JRun metadata objects: XML file web.xml jrun.xml application.xml XML element web-app servlet listener jrun-server service attribute application module Metadata object jrun.servlet.metadata.WebAppMetaData jrun.servlet.metadata.ServletMetaData jrun.servlet.metadata.ListenerMetaData jrunx.server
  • Adobe 38000382 | JRun Guide - Page 113
    XML metadata example The following example imports the web.xml file for the default server and adds a filter definition and filter mapping: import java.util.Map; import java.io.File; import jrun.servlet.metadata.WebAppMetaData; import jrun.servlet.metadata.FilterMetaData; import jrun.servlet.
  • Adobe 38000382 | JRun Guide - Page 114
    100 Chapter 9 Editing XML Files
  • Adobe 38000382 | JRun Guide - Page 115
    , accessing 49 jikes 75 JMC custom tag library 48 hiding 36 removing 44 setting user name and password 13 JMX adding security 91 MBeans 92 services 80 JRun components 5 executables 77 logo 40 JRun 3.x, migrating from 73 JRun API, overview 69 jrun command 74 JRun Management Console. See JMC JRun
  • Adobe 38000382 | JRun Guide - Page 116
    S samples server 36 SDK differences from retail version 2 documentation 7 downloading 2 software requirements 3 service attributes 49 service element, custom log event handler 83, 88 service paths 49 service security 91 services, attributes 80 Software Developoment Kit. See SDK software requirements
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116

JRun SDK Guide