44
TIBCO ActiveSpaces® Transactions Quick Start Guide Software Release 2.1.1 Published January 06, 2012

TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

TIBCO ActiveSpaces® Transactions

Quick Start Guide

Software Release 2.1.1Published January 06, 2012

Page 2: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Important InformationSOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCOSOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSEDTIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHERTIBCO SOFTWARE OR FOR ANY OTHER PURPOSE.

USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENTFOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATEAGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALL-ATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN LICENSE.PDF) OR IF THERE IS NO SUCH SOFTWARE LICENSEAGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OFTHE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALLCONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME.

This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this documentmay be reproduced in any form without the written authorization of TIBCO Software Inc.

TIB, TIBCO, TIBCO Adapter, Predictive Business, Information Bus, The Power of Now, TIBCO ActiveMatrix BusinessWorks, are eitherregistered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries.

EJB, Java EE, J2EE, and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in theU.S. and other countries.

All other product and company names and marks mentioned in this document are the property of their respective owners and are mentionedfor identification purposes only.

THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL OPERATING SYSTEMPLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THE README FILE FOR THEAVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEM PLATFORM.

THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.

THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLYADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT.TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S)DESCRIBED IN THIS DOCUMENT AT ANY TIME.

THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHERDOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND"READ ME" FILES.

Copyright © 2008, 2012 TIBCO Software Inc. ALL RIGHTS RESERVED, TIBCO Software Inc. Confidential Information

Page 3: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

ContentsAbout this book ................................................................................................................ vii

Terminology ............................................................................................................ vii1. Introduction ................................................................................................................... 1

What is ActiveSpaces® Transactions? .......................................................................... 1The ActiveSpaces® Transactions development model .................................................... 2The ActiveSpaces® Transactions Java SDK .................................................................. 2Hardware and software requirements .......................................................................... 2Lightning quick start .................................................................................................. 2

2. Installation and setup ...................................................................................................... 5Install VMware Player ................................................................................................ 5Install the SDK .......................................................................................................... 5Start the Development Appliance ................................................................................. 5

3. Building a simple application in Eclipse ............................................................................. 7Install and Start the ActiveSpaces® Transactions development appliance ........................ 7Create a new Java project ............................................................................................ 7Create a simple ActiveSpaces® Transactions application .............................................. 10Create a run configuration ......................................................................................... 13Run it! ..................................................................................................................... 15Using the ActiveSpaces® Transactions monitor ........................................................... 16

4. Debugging applications in Eclipse .................................................................................. 19Create a debug-enabled run configuration ................................................................... 19Create a remote debugger configuration ..................................................................... 20Run and debug the application ................................................................................... 21

5. Running the JMS example in Eclipse (with Maven) .......................................................... 23Install and Start the ActiveSpaces® Transactions development appliance ....................... 23Check out the examples source from the ActiveSpaces® Transactions public CVS serv-er ............................................................................................................................ 23Configure Eclipse to run the JMS example .................................................................. 31Running other examples in Eclipse ............................................................................ 33

Index .............................................................................................................................. 35

iii

Page 4: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

iv

Page 5: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

List of Figures2.1. Development Appliance welcome screen ........................................................................ 63.1. Creating the ActiveSpaces® Transactions Quick Start project .......................................... 83.2. Adding astdeploy.jar to the project libraries ..................................................................... 93.3. Create quickstart package ........................................................................................... 103.4. Create QuickStartObject class ..................................................................................... 113.5. Create the Main class ................................................................................................. 123.6. Creating a run configuration for quickstart ................................................................... 143.7. Configuring the VM arguments and working directory .................................................. 153.8. The output of the ActiveSpaces® Transactions Quick Start test application ...................... 163.9. Displaying the QuickStartObject in the ActiveSpaces® Transactions monitor ................... 174.1. Creating a debug run configuration .............................................................................. 204.2. Creating a debug configuration .................................................................................... 214.3. An excerpt of the Debug perspective - execution stopped at breakpoint ............................ 225.1. CVS Import ............................................................................................................... 245.2. Checkout from CVS .................................................................................................... 255.3. Select Module ............................................................................................................ 265.4. Check Out As ............................................................................................................. 275.5. Select Tag .................................................................................................................. 285.6. New Project ............................................................................................................... 295.7. New Java Project ........................................................................................................ 305.8. Package Explorer ....................................................................................................... 315.9. Run Configurations - jms ............................................................................................. 325.10. Console output for JMS example ................................................................................ 33

v

Page 6: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

vi

Page 7: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

About this bookThis guide describes how to quickly get started using the ActiveSpaces® Transactions™ softwareproduct.

This guide is part of a set of ActiveSpaces® Transactions documentation, which also includes:

ActiveSpaces® Transactions Administration Guide — This guide describes how to install,configure, and monitor a ActiveSpaces® Transactions deployment.

ActiveSpaces® Transactions Developer's Guide — This guide describes how to program aActiveSpaces® Transactions application.

ActiveSpaces® Transactions Performance Tuning Guide — This guide describes the toolsand techniques to tune ActiveSpaces® Transactions applications.

ActiveSpaces® Transactions System Sizing Guide — This guide describes how to size systemresources for ActiveSpaces® Transactions applications.

ActiveSpaces® Transactions Javadoc — The reference documentation for all ActiveSpaces®Transactions APIs.

Terminologycluster — A ActiveSpaces® Transactions cluster consists of one or more ActiveSpaces® Transactionsnodes, which may be configured for high availability.

node — A single instance of a ActiveSpaces® Transactions software execution environment.

ActiveSpaces® Transactions Administrator — A web browser user interface providing accessto ActiveSpaces® Transactions administration functions.

Domain manager — A specialized node providing management functions for ActiveSpaces®Transactions nodes.

vii

Page 8: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

viii

Page 9: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

1Introduction

This chapter provides an overview of the ActiveSpaces® Transactions development environment.

What is ActiveSpaces® Transactions?ActiveSpaces® Transactions is an in-memory transactional application server that provides scalablehigh-performance transaction processing with durable object management and replication. Act-iveSpaces® Transactions allows organizations to develop highly available, distributed, transactionalapplications using the standard Java POJO programming model.

ActiveSpaces® Transactions provides these capabilities:

• Transactions - high performance, distributed "All-or-None" ACID work.

• In-Memory Durable Object Store - ultra low-latency transactional persistence.

• Transactional High Availability - transparent memory-to-memory replication with instant fail-overand fail-back.

• Distributed Computing - location transparent objects and method invocation allowing transparenthorizontal scaling.

• Data Grid - secondary object storage, adhoc queries and notification of transactional data changes.

• Integrated Hotspot JVM - tightly integrated Java execution environment allowing transparent lowlatency feature execution.

1

Page 10: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

The ActiveSpaces® Transactions developmentmodel

Think of the ActiveSpaces® Transactions server as a sophisticated Java™ Virtual Machine (JVM).Your application is compiled in the normal way on your workstation, and sent to the ActiveSpaces®Transactions server for execution.

The ActiveSpaces® Transactions SDK includes a VMware® image containing a preconfiguredActiveSpaces® Transactions nodes. This VMware image can be run on your workstation if it isequipped with a 64-bit Intel® or AMD processor, or it may be run on a separate machine. Thisdocument assumes that the ActiveSpaces® Transactions server VMware image will be running onyour workstation.

Your IDE will be configured to run your ActiveSpaces® Transactions applications using astde-ploy.jar, which transparently sends the compiled Java classes to the server for execution.astdeploy.jar also contains the ActiveSpaces® Transactions software public interfaces.

The ActiveSpaces® Transactions Java SDKThe ActiveSpaces® Transactions Java SDK is delivered as a single zip file containing astde-ploy.jar, the ActiveSpaces® Transactions software documentation and examples, and theKabira-Server VMware image.

Hardware and software requirementsActiveSpaces® Transactions software applications must be compiled for JDK 1.5 or greater.

The requirements to run the ActiveSpaces® Transactions server VMware image are:

• Workstation with a 64-bit x86 processor (such as the Intel Core 2 Duo).

• VMware Player (or Workstation, Fusion, etc).

• 4 GB physical memory, more memory will significantly improve development performance forlarger applications.

• 4 GB free disk space

The examples in this guide use the Eclipse IDE (http://www.eclipse.org).

Lightning quick startFor the impatient, here are the minimal steps required to start using ActiveSpaces® Transactions.They will be explained in more detail in the following chapter.

1. Install VMWare Player (http://www.vmware.com/products/player).

2. Install (unzip) the ActiveSpaces® Transactions JAVASDK zip file.

3. Download ActiveSpaces® Transactions from https://download.tibco.com.

2

Chapter 1. Introduction

Page 11: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

4. Untar the downloaded product archive.

5. Copy the ISO product image from the product archive into the SDK. The ISO product image isnamed kabira-distrib.iso and is located in the kis directory in the product installationdirectory, for example /opt/ast/kis/kabira-distrib.iso. The ISO product image mustbe copied into the Kabira-Server directory in the SDK - for example /opt/ast/Kabira-Server/kabira-distrib.iso.

6. Start the Kabira-Server VMware image in VMware Player, and wait for the welcome page.

7. Set up your development environment for ActiveSpaces® Transactions software development:

• Set the JVM options to the "IDE configuration" string from the server's welcome page.

• Add astdeploy.jar to your project as a library to access the ActiveSpaces® Transactionssoftware interfaces.

8. Build and run your project.

3

Lightning quick start

Page 12: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

4

Page 13: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

2Installation and setup

This chapter describes how to install and configure the ActiveSpaces® Transactions Java SDK.

Install VMware PlayerDownload and install the free VMWare Player from http://www.vmware.com/download/player.You can download a tool to make sure your workstation can run 64-bit VMware images here ht-tp://www.vmware.com/download/ws/drivers_tools.html.

Install the SDKDownload the ActiveSpaces® Transactions SDK from DevZone[https://devzone.fluency.kabira.com/display/DOWN/Home]. Following the instructions on ex-tracting and updating the SDK in the release notes. See the Using the TIBCO ActiveSpaces®Transactions SDK section.

Start the Development ApplianceIn the directory where you extracted the ActiveSpaces® Transactions Java SDK zip file, find the filecalled Kabira-Server/Kabira-Server.vmx. Open this file in VMWare Player to start theActiveSpaces® Transactions Development Appliance.

When the Development Appliance startup is complete, you will be greeted with the welcome screen:

5

Page 14: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 2.1. Development Appliance welcome screen

The Development Appliance welcome screen contains several items which will be useful to you:

1. The getting started URL. This is the welcome page accessible from any Web browser.

2. The IDE configuration string.

3. Information on the Development Appliance nodes.

Managing the Development ApplianceEvery time you restart the Development Appliance VMware image, it resets to its original state.

To recover from any kind of error, all you need to do is select "Reset" from VMware Player's"Virtual Machine" sub-menu. To shut down the server, simply select Power Off from the"Virtual Machine" menu.

You can suspend the Development Appliance by closing VMware Player, and resume it by launchingVMware Player and selecting Kabira-Server from the Recent Virtual Machines list onthe VMware Player start page.

The next chapter will walk you through building a simple ActiveSpaces® Transactions exampleapplication and testing it on the Development Appliance.

6

Chapter 2. Installation and setup

Page 15: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

3Building a simple application in Eclipse

This chapter describes the basic process of configuring Eclipse for ActiveSpaces® Transactionsdevelopment. We'll build a simple ActiveSpaces® Transactions application in Eclipse, configureEclipse to run the application on the ActiveSpaces® Transactions Development Appliance, and runthe application.

Install and Start the ActiveSpaces® Transac-tions development appliance

Before you can run the examples in this chapter, you need to have set up the development applianceas described in Chapter 2. The following instructions assume that the ActiveSpaces® Transactionsserver development appliance is already running.

The examples shown in this chapter use the Eclipse Helios release.

Create a new Java projectFirst, we will create a new Java project, and include the ActiveSpaces® Transactions Java SDK asa support library.

Start Eclipse and create a new Java project:

1. In the File menu, select New ->Java Project.

2. In the New Java Project dialog that pops up, set the Project name to "ActiveSpaces® TransactionsQuick Start"

7

Page 16: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 3.1. Creating the ActiveSpaces® Transactions Quick Start project

3. Click "Next" to move to the Java Settings page.

4. Select the Libraries tab, and click on "Add External JARs..."

5. Browse to the folder where you installed the ActiveSpaces® Transactions Java SDK, and findthe file astdeploy.jar. Select it and click "OK".

8

Chapter 3. Building a simple application in Eclipse

Page 17: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 3.2. Adding astdeploy.jar to the project libraries

6. Select "Finish" to close the New Java Project window; Eclipse will generate the project structuresin your default workspace.

9

Create a new Java project

Page 18: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Create a simple ActiveSpaces® Transactionsapplication

Now that we have an Eclipse project with the right dependencies, we'll create a simple transactionalapplication.

1. In the File menu, select New -> Package. Name the new package quickstart, and then clickthe Finish button.

Figure 3.3. Create quickstart package

2. In the Package Explorer, right-click on the new quickstart package and select New -> Class.Set the class name to QuickStartObject. This will be our ActiveSpaces® Transactions man-aged type. Click the Finish button.

10

Chapter 3. Building a simple application in Eclipse

Page 19: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 3.4. Create QuickStartObject class

3. Now edit QuickStartObject.java in the edit pane. We will add an @Managed annotationto the class, and define a package-private String field named message. The class should looklike the following:

package quickstart;

import com.kabira.platform.annotation.Managed;

@Managedpublic class QuickStartObject { String message;}

As a Managed type, any instance of this object we create will be stored in ActiveSpaces® Trans-actions shared memory.

11

Create a simple ActiveSpaces® Transactions applic-ation

Page 20: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

4. Now we'll create another public class with a main() method. As before, right-click on thequickstart package and select New -> Class. Set the class name to Main, and let Eclipse gen-erate the method stub for us:

Figure 3.5. Create the Main class

5. Replace the empty main() method body with some transactional code. We'll create and updatean instance of the Managed QuickStartObject class we defined:

package quickstart;

import com.kabira.platform.Transaction;

public class Main {

public static void main(String[] args) {

12

Chapter 3. Building a simple application in Eclipse

Page 21: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

new Transaction() { @Override

public void run() throws Rollback { String message = "Welcome to ActiveSpaces® Transactions!"; System.out.println(message);

QuickStartObject quickStartObject = new QuickStartObject(); quickStartObject.message = message; } }.execute(); }}

6. Take a moment to check for any source errors identified by Eclipse. Under the File menu, selectSave all.

Create a run configurationNext we'll configure Eclipse to run our application on the ActiveSpaces® Transactions developmentappliance.

1. Under the Run menu, select Run Configurations...

2. In the left-hand pane of the Run Configurations window, right-click "Java Application". This willdefine a new run configuration.

3. In the Main tab, make sure that the "Main class:" is set to quickstart.Main. Eclipse shouldhave identified this for you; if not, click Search... and select the class.

13

Create a run configuration

Page 22: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 3.6. Creating a run configuration for quickstart

4. Next, select the "Arguments" tab. Here we will configure Eclipse to run the astdeploy client toolfor each invocation of the project.

In the "VM arguments" text box, copy the IDE configuration string from the welcome screen ofthe ActiveSpaces® Transactions development appliance.

The appliance will provide the correct hostname and adminport values for your installation.However, you must make sure to provide the complete path to astdeploy.jar. This will be thefolder where you installed the ActiveSpaces® Transactions Java SDK. (We used this path earlierto add the JAR dependency to the project).

For example, if the Java SDK was unpacked in /opt/ast , we would use the following argumentline:

-jar /opt/ast/astdeploy.jar hostname=192.168.28.129 adminport=2000domainnode=A username=guest password=guest

This commandline tells eclipse to wrap your project invocation with the development client inastdeploy.jar. The client takes parameters that tell it about the network location of the de-velopment appliance (the hostname and adminport values) as well as credentials to attach tothe server (the username and guest parameters).

The domainnode parameter selects the "A" node on the appliance to execute this application.

14

Chapter 3. Building a simple application in Eclipse

Page 23: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 3.7. Configuring the VM arguments and working directory

5. select Apply, then Close.

Run it!We're ready to run our test application.

Make sure the the ActiveSpaces® Transactions Quick Start project is selected in the Package Ex-plorer pane.

Under the "Run" menu, select "Run" (or click the green arrow "Run" icon in the toolbar). This willcompile the source, deploy the compiled class files and dependent classes to the ActiveSpaces®Transactions development appliance and execute the application there. The output of the exampleis displayed in the IDE console window as shown below:

15

Run it!

Page 24: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 3.8. The output of the ActiveSpaces® Transactions Quick Start testapplication

The build identifier and date may differ in your installation.

Using the ActiveSpaces® Transactions monit-or

Now that our application has created a Managed object, we can use the ActiveSpaces® Transactionsmonitor to see that object in persistent shared memory.

1. On the VMware console, in the "Development Appliance" section, click the link for node A. Aftera few seconds, the ActiveSpaces® Transactions monitor for that node will start.

2. On the left-hand side of the screen (under the File menu) there are 3 icons. Select the middleone (the tool tip says "Model View").

3. The left-hand pane will now show a listing of all Java types in shared memory. Expand quick-start.QuickStartObject, and click the single object reference for that type. In the right-hand pane, you will see the details of the QuickStartObject instance that the applicationcreated.

16

Chapter 3. Building a simple application in Eclipse

Page 25: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 3.9. Displaying the QuickStartObject in the ActiveSpaces®Transactions monitor

4. Each time you run the application, another instance of quickstart.QuickStartObject willbe created in the monitor. Experiment with adjusting the message or defining additional Managedtypes.

17

Using the ActiveSpaces® Transactions monitor

Page 26: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

18

Page 27: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

4Debugging applications in Eclipse

This chapter describes how to debug ActiveSpaces® Transactions applications in Eclipse. Theconfiguration for other Java IDEs is similar.

The process consists of the following general steps:

1. Configure Eclipse to run the application on the Develpoment Appliance in a debug-enabled mode.

2. Configure the Eclipse debugger to attach remotely to the ActiveSpaces® Transactions VM onthe Development Appliance.

3. Run the application in debug mode, then attach the remote debugger.

Create a debug-enabled run configurationThis chapter uses the example application that was described in Chapter 2. We will use a copy ofthe Run Configuration, with remote debugging services enabled.

1. Make sure the ActiveSpaces® Transactions Quick Start project is selected in the Package Explorer.

2. Under the "Run" menu, select "Run Configurations..." to display the run configuration dialog.

3. In the left pane of the dialog, under the Java Application type, click to select the Main configuration.

4. Click the "Duplicate" button to make a copy.

5. Name the new configuration "Debug".

6. Click the Arguments tab. Add the following to the "VM arguments" field:

remotedebug=true remotedebugport=6666 suspend=true

19

Page 28: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

These arguments instruct the runtime environment to listen for remote debuggers on port 6666.The suspend argument instructs the runtime to pause and wait for a debugger to attach beforeinvoking the main method of the application.

Figure 4.1. Creating a debug run configuration

7. Click Apply and then Close.

Create a remote debugger configurationThe "Debug" run configuration will execute the Quick Start application in a remote-debug mode.Now we must configure the Eclipse debugger to attach to a remote Java Virtual Machine.

1. Make sure the ActiveSpaces® Transactions Quick Start project is selected in the Package Explorer.

2. Under the "Run" menu, select "Debug Configurations..." to display the debug configuration dialog.

3. In the left pane, select the "Remote Java Application" config type, then click the New button.

4. In the "Connect" tab, provide remote address information for the "Connection Properties" section:

• Set "Host" to the address from the ActiveSpaces® Transactions development appliance welcomescreen. (This is the same as the address used in the Run Configuration)

20

Chapter 4. Debugging applications in Eclipse

Page 29: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

• Set "Port" to match the remotedebugport that was defined in the run configuration - 6666.

5. Click "Apply" to save the configuration, and then close the dialog.

Figure 4.2. Creating a debug configuration

Run and debug the applicationDebugging the application is a two-part process. First you run the application using the Debug runconfiguration, which will start the debug listener on the Development Appliance. Then you launchthe Eclipse remote debugger and connect to the Virtual Machine.

1. Set a breakpoint in your application: select a source line in the main method. Under the "Run"menu, select "Toggle line breakpoint".

2. Under the "Run" menu, select "Run Configurations...". Select the Debug configuration.

3. Click the Run button to start the application. You'll see output in the console window ending with:

[A] Listening for transport dt_socket at address: 6666

4. Now, choose the Debug perspective (the selector is in the top right tab, or look under the"Window" menu and select "Open Perspective").

5. Under the "Run" menu, select "Debug Configurations".

6. In the left pane, select the debug configuration created earlier - the default name is QuickStartO-bject.

21

Run and debug the application

Page 30: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

7. Click the Debug button.

Eclipse returns to the debug perspective, and the Eclipse remote debugger connects to the Act-iveSpaces® Transactions node. The application will start and run until the breakpoint you set isreached.

Figure 4.3. An excerpt of the Debug perspective - execution stopped atbreakpoint

Now you can:

• Set more breakpoints;

• Examine variables in the "Variables" (top-right) pane;

• Step through program execution a line at a time;

• Display thread stacks by drilling down into the Remote Java Application entry in the Debug pane(top-left).

As you debug the application, its console output continues to be displayed in the debug perspectiveConsole tab.

22

Chapter 4. Debugging applications in Eclipse

Page 31: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

5Running the JMS example in Eclipse(with Maven)

This chapter shows how to run an ActiveSpaces® Transactions example using Eclipse. To run theexamples in Eclipse, you will need a version of Eclipse that supports Maven. Version 3.7.1.x is knownto work.

Install and Start the ActiveSpaces® Transac-tions development appliance

Before you can run the ActiveSpaces® Transactions examples, you need to have set up the devel-opment appliance as described in Chapter 2. The following instructions assume that the Act-iveSpaces® Transactions development appliance is already running.

Check out the examples source from theActiveSpaces® Transactions public CVSserver

1. From the File menu, select Import -> CVS -> Projects from CVS and click Next.

23

Page 32: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 5.1. CVS Import

2. In the Checkout from CVS dialog, enter the following:

downloads.fluency.kabira.comHost

/opt/cvsrootRepository path

anonymousUser

(leave blank)Password

pserverConnection type:

Click Finish.

24

Chapter 5. Running the JMS example in Eclipse(with Maven)

Page 33: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 5.2. Checkout from CVS

3. In the next screen, select Use an existing module [...], then select examples andclick on Next.

25

Check out the examples source from the Act-iveSpaces® Transactions public CVS server

Page 34: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 5.3. Select Module

4. In the Check Out As screen, select Check out as a project configured usingthe New Project Wizard. Click Next.

26

Chapter 5. Running the JMS example in Eclipse(with Maven)

Page 35: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 5.4. Check Out As

5. From the Select Tag dialog select Versions and click on the expand triangle to see theavailable versions. Select the examples version that should be checked out. Click on Finish.

27

Check out the examples source from the Act-iveSpaces® Transactions public CVS server

Page 36: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 5.5. Select Tag

6. From the Select a Wizard dialog, select Java Project. Click Next.

28

Chapter 5. Running the JMS example in Eclipse(with Maven)

Page 37: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 5.6. New Project

7. Provide a Project name and click on Finish.

29

Check out the examples source from the Act-iveSpaces® Transactions public CVS server

Page 38: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 5.7. New Java Project

8. From the package explorer right click on the package name and select Configure->Convertto Maven.

30

Chapter 5. Running the JMS example in Eclipse(with Maven)

Page 39: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

Figure 5.8. Package Explorer

Configure Eclipse to run the JMS exampleNow we'll configure Eclipse to run the examples on the ActiveSpaces® Transactions Server devel-opment appliance.

31

Configure Eclipse to run the JMS example

Page 40: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

1. Under the "Run" menu, select "Run Configurations".

2. Right-click on on Maven Build, and select "New".

3. Rename "New_Configuration" to jms.

4. In the Main tab,

• Set the Base directory: choose Browse Workspace, select jms, and click OK.

• Set Goals to compile fluency:exec.

• Set the following parameters:

(The IP address of the ActiveSpaces® Transactionsdevelopment appliance - from the VMWare console)

com.kabira.fluency.hostName

2000com.kabira.fluency.administrationPort

Acom.kabira.fluency.domainNode

guestcom.kabira.fluency.username

guestcom.kabira.fluency.password

Figure 5.9. Run Configurations - jms

32

Chapter 5. Running the JMS example in Eclipse(with Maven)

Page 41: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

5. Click the "Apply" button.

6. Click "Run" to build and run the JMS example. The console pane will open and you should seea bunch of output, ending with:

Figure 5.10. Console output for JMS example

Running other examples in EclipseThe other examples in the examples project may also be run in Eclipse. See the site documentationon the Components and Examples [https://devzone.fluency.kabira.com/display/comp/Home]page of the DevZone [https://devzone.fluency.kabira.com].

33

Running other examples in Eclipse

Page 42: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

34

Page 43: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

IndexAActiveSpaces® Transactions

JVM, 1ActiveSpaces® Transactions Administrator, viiActiveSpaces® Transactions server, 2astdeploy.jar

in run configuration, 13introduced, 2

Bbreakpoints, 22

Cclusters, viiCPU requirements, 2

Ddebug run configuration, 19debugging, 19-22

attaching the debugger, 21configuring, 19-20starting, 21

Development Appliancerestart/reset, 6starting, 5

development environmentinstallation and setup, 5overview, 1

domain manager, vii

Iimage requirements

VMware, 2installation and setup, 5

JJDK version, 2JVM

ActiveSpaces® Transactions server, 2

Mmemory requirements, 2

Nnodes, vii

Rrequirements

system, 2run configuration, 13

debug, 19

Sserver

preconfigured development environment (see Act-iveSpaces® Transactions server)

system requirements, 2

VVMware

64-bit image capability check, 5image requirements, 2

VMware image, 2restart/reset, 6

VMware Playerinstalling, 5

35

Page 44: TIBCO ActiveSpaces® Transactionsdownloads.fluency.kabira.com/fluency/.../documentation/guides/quickstart.pdf · tibco softw are. the embedded or bundled softw are is not licensed

36