TIBCO BusinessEvents® Extreme
ships with a deployment tool that is used to
deploy applications to TIBCO BusinessEvents® Extreme
nodes. The deployment tool can be
used from the command line or via a Java IDE. The TIBCO BusinessEvents® Extreme
deployment
tool is named deploy.jar
.
The general syntax for using the deployment tool is:
java [local JVM options] -jar deploy.jar [options] <target> [application parameters] java [local JVM options] -jar deploy.jar [options] help
deploy.jar
must be specified as the first
-jar
option. This ensures that the deployment tool gets
control during the execution of the application and manages execution and
debugging of the application on an TIBCO BusinessEvents® Extreme
node.
is
used to pass options to the local JVM. These options are specific to the
version of the local JVM.[local JVM options]
consists of
any combination of JVM options (See the section called “Supported JVM properties”)
or deployment tool options (See Table 14.1, “Deployment tool options”). JVM options are prefixed with
a "[options]
-
", while deployment tool options are of the form
name
=
value
.
<target>
is the application archive
file, e.g. a JAR file, or class that will be executed on the node.
[application parameters]
are application
specific parameters that are passed to the application program's
main.
The
command displays the
usage message.help
Table 14.1, “Deployment tool options” summarizes the supported deployment tool options:
Table 14.1. Deployment tool options
The reset
option provides development
support for changing the shape of Managed Objects in shared memory. It
has no affect on non-managed Java objects.
![]() | |
The |
Reset processing takes place during JVM initialization. The following steps are taken to reset shared memory:
Check to make sure that there are no other JVMs running. If there are other JVMs running, the new JVM initialization will fail with an error message. Reset can only be done when there are no JVMs running on a node.
Delete all managed objects in shared memory. If the managed object is a distributed object on a remote node, dispatch the delete to the remote node. If the remote node cannot be reached, delete the cached copy on the local node.
Remove all type definitions from shared memory. They will be redefined as part of class loading as the application executes.
Examples of changing the shape of a Managed Object are:
adding a field to a class
removing a field from a class
changing the type of a field in a class
changing the inheritance hierarchy
TIBCO BusinessEvents® Extreme
detects when the shape of a Managed Object changes
and fails the load of the changed class definition if reset =
false
.
For example, if Example 14.1, “Type change” is run twice -
once with m_string
not commented out, and then again
with m_string
commented out with reset =
false
(the default value):
Example 14.1. Type change
// $Revision: 1.1.2.1 $ package com.kabira.snippets.reference; import com.kabira.platform.Transaction; import com.kabira.platform.annotation.Managed; /** * Snippet used to demonstrate changing the shape of a class * <p> * <h2> Target Nodes</h2> * <ul> * <li> <b>domainnode</b> = A * </ul> */ public class Shape { /** * A managed object */ @Managed public static class ShapeChange { private int m_int; // // Uncomment this field after running once to see // type conflict // // private String m_string; } /** * Main entry point * @param args Not used */ public static void main(String args[]) { new Transaction("Create Object") { @Override protected void run() throws Rollback { new ShapeChange(); } }.execute(); } }
On the second run, the following exception is thrown:
Example 14.2. Type change - second run output
[A] Java main class com.kabira.snippets.reference.Shape.main exited with an exception. [A] Java exception occurred: Audit of class [com.kabira.snippets.reference.ShapeChange] failed: Type did not match. New type name com.kabira.snippets.reference.ShapeChange - existing type name com.kabira.snippets.reference.ShapeChange. Changed values :numberSlots:objectSize:; the class will not be loaded. [A] at com.kabira.platform.classloader.ClassLoader.createKTPTypeDescriptor (Native Method) [A] at com.kabira.platform.classloader.ClassLoader.defineManagedClass (ClassLoader.java:642) [A] at com.kabira.platform.classloader.ClassLoader.findClass(ClassLoader.java:302) [A] at com.kabira.platform.classloader.ClassLoader.loadClass(ClassLoader.java:228) [A] at java.lang.ClassLoader.loadClass(ClassLoader.java:251) [A] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) [A] at com.kabira.snippets.reference.Shape.run(Shape.java:37) [A] at com.kabira.platform.Transaction.execute(Transaction.java:132) [A] at com.kabira.snippets.reference.Shape.main(Shape.java:31) INFO: Application [com.kabira.snippets.reference.Shape6] running on node [A] exited with status [-1] INFO: Run of distributed application [com.kabira.snippets.reference.Shape6] complete.
Setting reset = true
will avoid this
exception.
When highly available or distributed Managed Objects are
used in an application, the type definition for these classes are
pushed to all nodes in a cluster. To ensure that the type definitions
stay consistent on all nodes, the same value for the
reset
option must be sent to all nodes. This is
accomplished using the Distributed Development features as described
in Chapter 2, Developing distributed applications.
Using inconsistent values for the
reset
option on nodes in a cluster will cause
application failures because of the inconsistent type definitions on
the nodes. The cluster must be restarted to resolve this
problem.
The TIBCO BusinessEvents® Extreme
deployment tool will prompt for a password if
one is not specified on the command line, or in the
options
file, using the password
parameter.
The TIBCO BusinessEvents® Extreme
deployment tool always uses SSL
connections to TIBCO BusinessEvents® Extreme
nodes. This requires an SSL
TrustManagerFactory
algorithm that supports storage
and management of X.509v3 credentials. By default the
SunX509
TrustManagerFactory
is
used. If that TrustManagerFactory
algorithm is not
supported in the JRE being used to execute the deployment tool, an
alternative algorithm can be specified using the
ssl.TrustManagerFactory.algorithm
JVM system
property.
The algorithm specified using the above property must reference a
which supports
storage and management of X.509v3 credentials and is provided by the JRE
being used.TrustManagerFactory
When the TIBCO BusinessEvents® Extreme deployment tool is executed it looks for the following file:
<user home directory>/.ast/options
If this file exists, any deployment tool command line options in
the options
file are used. Command line options
specified in the options
file have the same affect as
the same command line option specified on the command line.
Options on the command line override the same option in the
options
file. For example if the command line
contains -jar deploy.jar debug=true
and the options
file contains debug = false
, a debug value of
true
is used for the application execution.
The options file must follow the format below.
# # Any line starting with '#' is ignored # # Each option is specified on a separate line, as follows: # <option name> = <option value>[newline]
For example, the following options
file would
set up the default username and password for use with the TIBCO BusinessEvents® Extreme
development nodes:
# # Username and password for TIBCO BusinessEvents® Extreme development nodes # username = guest password = guest
The options file also supports defining default JVM
properties for the TIBCO BusinessEvents® Extreme
JVM. Default TIBCO BusinessEvents® Extreme
JVM
properties are specified using the jvmoptions
option name. Here is an example of using the
jvmoptions
option.
# # Username and password for TIBCO BusinessEvents® Extreme development nodes # username = guest password = guest # # Default JVM options # jvmoptions = -Duser.name=fred -Duser.country=US
Example 14.3, “Deployment example” shows how to deploy a simple Java program to an TIBCO BusinessEvents® Extreme node from the command line.
Example 14.3. Deployment example
// $Revision: 1.1.2.1 $ package com.kabira.snippets.reference; /** * Simple hello world snippet * <p> * <h2> Target Nodes</h2> * <ul> * <li> <b>domainnode</b> = A * </ul> */ public class HelloWorld { /** * Main entry point * @param args Not used */ public static void main(String args[]) { System.out.println("Hello World"); } } # # NOTE: Remove the package statement from the HelloWorld.java snippet above # to work with the example steps below. # # # Compile the program using the native javac on the host machine # javac HelloWorld.java # # Excute the program against an TIBCO BusinessEvents® Extreme node - assumes deploy.jar is in local directory * java -jar deploy.jar hostname=192.168.1.128 adminport=2001 \ username=guest password=guest HelloWorld # # The output from the command # INFO: deploy.jar version: [core_linux081117] INFO: node version: [core_linux081117] Hello World