ControlTier > controltier-elements
 

JavaServiceWrapper

Windows platform integration of Tanuki Software's Java Wrapper Service facility

Overview

Open in Workbench JavaServiceWrapper: Windows platform integration of Tanuki Software's Java Wrapper Service facility

This type manages the Tanuki Software Java Wrapper Service, and allows a dependent Service object to be automatically deployed.

A JavaServiceWrapperZip object should be added as a child dependency.

A Service object should also be added as a child dependency.

Appropriate Settings should be added to JavaServiceWrapper object to configure the appropriate Java based configuration to run the underlying Service.

An example of using JavaServiceWrapper for managing the JBossServer type is here: Windows service example.

See: Tanuki Software Ltd. - Java Service Wrapper.

Design

Super Type
Service
Role Concrete. (Objects can be created.)
Instance Names Unique
Notification false
Template Directory
Data View Children, proximity: 1
Logger Name

Constraints

Attributes

Exported Attributes

Name Property Description
installRoot deployment-install-root The deployment-install-root is exported as the "installRoot" attribute. It is used to default the -installroot option in many commands.

Defaults for Imported Attributes

Name Default
javaServiceWrapperConsoleTitle Test Wrapper Sample Application
javaServiceWrapperJavaHome ${env.JAVA_HOME}
javaServiceWrapperJavaInitMemory 3
javaServiceWrapperJavaMainClass org.tanukisoftware.wrapper.WrapperSimpleApp
javaServiceWrapperJavaMaxMemory 64
javaServiceWrapperNtServiceDescription Test Wrapper Sample Application Description
javaServiceWrapperNtServiceDisplayName Test Wrapper Sample Application
javaServiceWrapperNtServiceInteractive false
javaServiceWrapperNtServiceName testwrapper
javaServiceWrapperNtServiceStartType AUTO_START

Commands

Note
Commandline options displayed in square brackets "[]" are optional. If an option expects arguments, then angle brackets are shown after the option "<>". Any default value is shown within the brackets.

Deploy

Run the service deployment cycle, stopping, unconfiguring, installing package dependencies, installing the dependent Service, and configuring and the starting the service. .

This implementation overrides the default Deploy command to insert the Service-Install command after the Packages-Install command. This allows the JavaServiceWrapper object to perform selective parts of the normal Deploy workflow for its dependent Service child, without invoking the normal Start and Stop lifecycle commands for the Service.

The JavaServiceWrapper's Start and Stop commands invoke the Tanuki Software Java Service Wrapper start/stop commands, which invoke the Windows Service management operations to directly start or stop the underlying Java based Service software.

Usage
Deploy

Workflow

  1. Stop
  2. Remove
  3. Packages-Install
  4. Service-Install
  5. Configure
  6. Add
  7. Start

Add

Add the Java Service Wrapper Windows service if it is not already installed.

This workflow idempotently registers this object as a Windows service using the Tanuki Java Service Wrapper software.

Usage
Add

Workflow

  1. assertServiceIsInstalled

Error Handler

Command

addService

Remove

Remove the Java Service Wrapper Windows service if it is installed.

This workflow idempotently de-registers this object as a Windows service using the Tanuki Java Service Wrapper software.

Usage
Remove

Workflow

  1. assertServiceIsNotInstalled

Error Handler

Command

removeService

Service-Install

Install a dependent Service object without starting it directly

This workflow command dispatches the necessary commands to the dependent Service object to install it: Install, Packages-Install, and Configure.

Usage
Service-Install

Workflow

  1. dispatchServiceInstall
  2. dispatchServicePackagesInstall
  3. dispatchServiceConfigure

dispatchServiceInstall

Dispatch the Install command to a dependent service object

Dispatch the "Install" command to a dependent Service.

Usage
dispatchServiceInstall

dispatchServiceConfigure

Dispatch the Configure command to a dependent service object

Dispatch the "Configure" command to a dependent Service.

Usage
dispatchServiceConfigure

dispatchServicePackagesInstall

Dispatch the Packages-Install command to a dependent service object.

Dispatch the "Packages-Install" command to a dependent Service.

Usage
dispatchServicePackagesInstall

Docs-Generate

Generate the server properties file

Generates the wrapper.conf file based on the Settings and attribute defaults of this object.

Usage
Docs-Generate [-installroot <>] [-packagebase <>]

Options

Option Description
installroot Java wrapper service wrapper home directory
packagebase Java wrapper service wrapper package installation directory

addService

Add the Java Service Wrapper Windows service to the system

Directly registers the Windows service using the Java Service Wrapper software.

Usage
addService [-installroot <>] [-packagebase <>]

Options

Option Description
installroot Java wrapper service wrapper home directory
packagebase Java wrapper service wrapper package installation directory

removeService

Remove the Java Service Wrapper Windows service from the system

Directly de-registers the Windows service using the Java Service Wrapper software.

Usage
removeService [-installroot <>] [-packagebase <>]

Options

Option Description
installroot Java wrapper service wrapper home directory
packagebase Java wrapper service wrapper package installation directory

assertServiceIsUp

Check whether the Java Service Wrapper Windows service is up

Queries the state of the Windows service using the Java Service Wrapper software, and fails if the state is not "running".

Usage
assertServiceIsUp [-installroot <>] [-packagebase <>] [-servicename <>]

Options

Option Description
installroot Java wrapper service wrapper home directory
packagebase Java wrapper service wrapper package installation directory
servicename Java wrapper service wrapper Windows service name

assertServiceIsDown

Check whether the Java Service Wrapper Windows service is down

Queries the state of the Windows service using the Java Service Wrapper software, and fails if the state is "running".

Usage
assertServiceIsDown [-installroot <>] [-packagebase <>] [-servicename <>]

Options

Option Description
installroot Java wrapper service wrapper home directory
packagebase Java wrapper service wrapper package installation directory
servicename Java wrapper service wrapper Windows service name

assertServiceIsInstalled

Check whether the Java Service Wrapper Windows service is installed

Queries the state of the Windows service using the Java Service Wrapper software, and fails if the state is not "installed".

Usage
assertServiceIsInstalled [-installroot <>] [-packagebase <>] [-servicename <>]

Options

Option Description
installroot Java wrapper service wrapper home directory
packagebase Java wrapper service wrapper package installation directory
servicename Java wrapper service wrapper Windows service name

assertServiceIsNotInstalled

Check whether the Java Service Wrapper Windows service is not installed

Queries the state of the Windows service using the Java Service Wrapper software, and fails if the state is "installed".

Usage
assertServiceIsNotInstalled [-installroot <>] [-packagebase <>] [-servicename <>]

Options

Option Description
installroot Java wrapper service wrapper home directory
packagebase Java wrapper service wrapper package installation directory
servicename Java wrapper service wrapper Windows service name

startService

Start the Java Service Wrapper Windows service

Directly starts the Windows service using the Java Service Wrapper software.

Usage
startService [-installroot <>] [-packagebase <>] [-servicename <>]

Options

Option Description
installroot Java wrapper service wrapper home directory
packagebase Java wrapper service wrapper package installation directory
servicename Java wrapper service wrapper Windows service name

stopService

Stop the Java Service Wrapper Windows service

Directly stops the Windows service using the Java Service Wrapper software.

Usage
stopService [-installroot <>] [-packagebase <>] [-servicename <>]

Options

Option Description
installroot Java wrapper service wrapper home directory
packagebase Java wrapper service wrapper package installation directory
servicename Java wrapper service wrapper Windows service name

Related Types

The following types are defined for use with JavaServiceWrapper.

JavaServiceWrapperSetting

Overview

Open in Workbench JavaServiceWrapperSetting: Java Service Wrapper configuration setting

This abstract Setting subtype is the supertype for all JavaServiceWrapper Setting types.

Design

Super Type
Setting
Role Abstract. (Objects cannot be created.)
Instance Names Unique

JavaServiceWrapperJavaHome

Overview

Open in Workbench JavaServiceWrapperJavaHome: Value of JAVA_HOME for the Java Service Wrapper

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperJavaHome settingValue

JavaServiceWrapperJavaMainClass

Overview

Open in Workbench JavaServiceWrapperJavaMainClass: Class implementing the Java Service Wrapper WrapperListener interface

The main class to set with this Setting is most often one provided by the Tanuki software, such as "org.tanukisoftware.wrapper.WrapperSimpleApp", unless target Java software to manage has its own implementation.

See: Java Service Wrapper - Integration Methods.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperJavaMainClass settingValue

JavaServiceWrapperJavaClassPath

Overview

Open in Workbench JavaServiceWrapperJavaClassPath: A list of additional CLASSPATH elements for the Java Service Wrapper, comma separated

The comma-separated java class paths for this Setting will be added to a default set which includes the necessary jars for the Tanuki service wrapper software.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperJavaClassPath settingValue

JavaServiceWrapperJavaAdditional

Overview

Open in Workbench JavaServiceWrapperJavaAdditional: A list of additional JAVA_OPTS for the Java Service Wrapper, space separated

The values are split at the space characters and generated into the wrapper.conf file as separate numbered properties.

See: wrapper.java.additional<n> Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperJavaAdditional settingValue

JavaServiceWrapperJavaInitMemory

Overview

Open in Workbench JavaServiceWrapperJavaInitMemory: Initial Java heap size in MB for the Java Service Wrapper

Used in the wrapper.conf configuration file.

See: wrapper.java.initmemory Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperJavaInitMemory settingValue

JavaServiceWrapperJavaMaxMemory

Overview

Open in Workbench JavaServiceWrapperJavaMaxMemory: Maximum Java heap size in MB for the Java Service Wrapper

Used in the wrapper.conf configuration file.

See: wrapper.java.maxmemory Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperJavaMaxMemory settingValue

JavaServiceWrapperAppParameters

Overview

Open in Workbench JavaServiceWrapperAppParameters: Application commandline parameters for the Java Service Wrapper, space separated.

The value should be a space separated list of parameters to pass to the main class defined with a JavaServiceWrapperJavaMainClass Setting object.

When the JavaServiceWrapperMainClass value is "org.tanukisoftware.wrapper.WrapperSimpleApp", then the value of this setting should be the Main class name of the target Java application, followed by the commandline parameters separated by spaces.

For example:

org.myapp.Main -param value

See: Java Service Wrapper - Integration Methods.

See: wrapper.java.mainclass Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperAppParameters settingValue

JavaServiceWrapperConsoleTitle

Overview

Open in Workbench JavaServiceWrapperConsoleTitle: Title to use when running the Java Service Wrapper as a console

If configured to run in a console window, this will be the title given to the window.

See: wrapper.console.title Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperConsoleTitle settingValue

JavaServiceWrapperNtServiceName

Overview

Open in Workbench JavaServiceWrapperNtServiceName: Identifying Name of the Java Service Wrapper Windows service

This is the identifier used by Windows, and should be unique among all Windows Service. Make sure that all JavaServiceWrapper objects have different values for this setting.

See: wrapper.ntservice.name Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property Description
javaServiceWrapperNtServiceName settingValue This attribute is used by the lifecycle commands of JavaServiceWrapper to uniquely identify the Windows Service that is being managed.

JavaServiceWrapperNtServiceDisplayName

Overview

Open in Workbench JavaServiceWrapperNtServiceDisplayName: Displayed name of the Java Service Wrapper Windows service

See: wrapper.ntservice.displayname Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperNtServiceDisplayName settingValue

JavaServiceWrapperNtServiceDescription

Overview

Open in Workbench JavaServiceWrapperNtServiceDescription: Description of the Java Service Wrapper Windows service

See: wrapper.ntservice.description Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperNtServiceDescription settingValue

JavaServiceWrapperNtServiceStartType

Overview

Open in Workbench JavaServiceWrapperNtServiceStartType: Mode in which the Java Service Wrapper Windows service is installed. AUTO_START or DEMAND_START.

See: wrapper.ntservice.starttype Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies
Allowed Property Values
Property Allowed Values Default Enforced
settingValue
  • AUTO_START
  • DEMAND_START
  • AUTO_START
true

Attributes

Exported Attributes
Name Property
javaServiceWrapperNtServiceStartType settingValue

JavaServiceWrapperNtServiceInteractive

Overview

Open in Workbench JavaServiceWrapperNtServiceInteractive: Whether or not to allow the Java Service Wrapper Windows service to interact with the desktop. (true/false)

See: wrapper.ntservice.interactive Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies
Allowed Property Values
Property Allowed Values Default Enforced
settingValue
  • false
  • true
  • true
true

Attributes

Exported Attributes
Name Property
javaServiceWrapperNtServiceInteractive settingValue

JavaServiceWrapperNtServiceAccount

Overview

Open in Workbench JavaServiceWrapperNtServiceAccount: Account to use with the Java Service Wrapper Windows service.

Note
The usage of this setting is not currently enabled in this implementation.

See: wrapper.ntservice.account Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperNtServiceAccount settingValue

JavaServiceWrapperNtServicePassword

Overview

Open in Workbench JavaServiceWrapperNtServicePassword: Password to use with the Java Service Wrapper Windows service.

Note
The usage of this setting is not currently enabled in this implementation.

See: wrapper.ntservice.password Property.

Design

Super Type
JavaServiceWrapperSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies

Attributes

Exported Attributes
Name Property
javaServiceWrapperNtServicePassword settingValue