Monday, August 21, 2006

Eclipse Test and Performance Tools Platform

Eclipse Test and Performance Tools Platform (TPTP) provides a comprehensive suite of open source performance-testing and profiling tools, including integrated application monitoring, testing, tracing and profiling log analyzing and static-code analysis tools. The Eclipse Callisto 3.2 release includes version 4.2 of the Eclipse Test & Performance Tools Platform (TPTP). OnJava.com recently featured an introduction to using the tool. TPTP lets you test several aspects of your application's behavior, including memory usage, execution statistics, and test coverage.

Installing TPTP

Open the Remote Update window (Help -> Software Updates -> Find and Install), and select the Callisto Discovery Site. If Callisto Discovery Site is not listed, add a "New Remote Site", and add http://download.eclipse.org/callisto/releases/, to the list and select it. You will have to select the "Charting and Reporting", "Enabling features" and "Testing and Performance" options to install.

Profiling with Eclipse TPTP

Follow these steps to profile an application
  1. Create a JUnit test profile using "Run -> Profile" option from the main menu. If you have a test package, it will be automatically selected in the "Test" tab of the profile dialog box.
    Eclipse TPTP profiling -1
  2. Select the "Monitor" tab and choose the required options.
    Eclipse TPTP profiling - 2
  3. Click on profile.
Once eclipse finishes profiling, you can go to the "Profiling and Logging" perspective and analyze the results of the profiler.
References:
  1. Profiling Your Applications with Eclipse Callisto
  2. Eclipse Test and Performance Tools Platform
  3. Introduction: Eclipse Test and Performance Tools Platform (Tutorial)
  4. Eclipse Test and Performance Tools Platform, Part 1: Test, profile, and monitor applications (Tutorial)
  5. Eclipse Test and Performance Tools Platform, Part 2: Monitor applications (Tutorial)

Tuesday, August 15, 2006

Opensourcing Java

Sun has provided some further details of its plans to open-source its JDK, including the unveiling of a new Open Sourcing the JDK java.net page for updates and discussion.

Thursday, August 10, 2006

Spring 2 and JPA tutorials

A new tutorial on Developerworks,"Introduction to Spring 2 and JPA" discusses the use of Spring 2 framework and Java Persistence API (JPA). You will build a Web application from scratch, step by step, assisted by the Spring 2 framework.
This tutorial does not attempt to cover all of Spring 2's features and options. Instead, it focuses narrowly on one proven approach to server application development using Spring. You will proceed through a complete "from concept to application" cycle, including:
  • Performing domain analysis
  • Coding business objects and services
  • Unit testing of business objects
  • Adding data access code painlessly to business objects using Spring JPA
  • Implementing your services using Spring DAO (data access object)
  • Coding integration tests for your services against DB2 Express-C
  • Creating controllers for a Spring Model-View-Controller (MVC) based user interface
  • Designing views for the user interface
  • Creating a deployable WAR file of your application
  • Configuring and deploying your application on the Apache Tomcat server
The following is a list of other related articles for different application server environments

Tuesday, August 08, 2006

SOA for Dummies Book IBM Edition

Bobby woolf writes:

There is (will be) an SOA for Dummies book. And IBM will send you a copy for free.

Go to SOA for Dummies Book IBM Edition and log into your IBM account (such as your developerWorks login) (or create one). As usual, it prompts you to verify and update your personal information; make sure your mailing address is correct! Because when you press Submit, the next screen says, "You [sic] book will be shipped right away."

What you'll get (according to Sandy) is a copy of Service-Oriented Architecture For Dummies (Amazon) ("The fun and easy way to find out about SOA." SOA, fun and easy?!) which is scheduled to be available 4Q06. I haven't seen the book, so I don't know if it's any good or not. But the price is right, at least when you get the hookup from IBM.

Monday, August 07, 2006

JDBC 4.0 in Mustang

In a recent article, Srini Penchikala offers a thorough overview of the database changes in Mustang in JDBC 4.0 Enhancements in Java SE 6. This article provides an overview of the JDBC 4.0 enhancements and what benefits they offer to enterprise Java developers." Here is a summary: The major features added in JDBC 4.0 include:
  1. Auto-loading of JDBC driver class: No need to explicitly load JDBC drivers using Class.forName(). When the method getConnection is called, the DriverManager will attempt to locate a suitable driver from among the JDBC drivers that were loaded at initialization and those loaded explicitly using the same class loader as the current application.
  2. Connection management enhancements: We can get a connection to any data source by simply supplying a set of parameters (such as host name and port number) to a standard connection factory mechanism. New methods were added to Connection and Statement interfaces to permit improved connection state tracking and greater flexibility when managing Statement objects in pool environments.
  3. Support for RowId SQL type: The RowID interface was added to JDBC 4.0 to support the ROWID data type which is supported by databases such as Oracle and DB2. RowId is useful in cases where there are multiple records that don't have a unique identifier column and you need to store the query output in a Collection (such Hashtable) that doesn't allow duplicates. We can use ResultSet's getRowId() method to get a RowId and PreparedStatement's setRowId() method to use the RowId in a query.
  4. DataSet implementation of SQL using Annotations: The JDBC 4.0 specification leverages annotations (added in Java SE 5) to allow developers to associate a SQL query with a Java class without writing a lot of code to achieve this association. Also, by using the Generics (JSR 014) and metadata (JSR 175) APIs, we can associate the SQL queries with Java objects specifying query input and output parameters.
  5. SQL exception handling enhancements:
    1. New SQLException sub-classes
    2. Support for causal relationships
    3. Support for enhanced for-each loop
  6. SQL XML support: Introduces the notion of how to express XML data in a SQL datastore. Additional APIs have been added to allow applications access to thisdata.

Thursday, August 03, 2006

Using jCIFS for Authentication

JCIFS is an Open Source client library that implements the CIFS/SMB networking protocol in 100% Java. CIFS is the standard file sharing protocol on the Microsoft Windows platform (e.g. Map Network Drive ...). This client is used extensively in production on large Intranets. The JCIFS SMB client library enables Java applications to remotely access shared files and directories on SMB file servers(i.e. a Microsoft Windows "share") in addition to domain, workgroup, and server enumeration of NetBIOS over TCP/IP networks. It is an advanced implementation of the CIFS protocol supporting Unicode, batching, multiplexing of threaded callers, encrypted authentication, transactions, the Remote Access Protocol (RAP), and much more. It is licensed under LGPL which means commercial organizations can legitimately use it with their proprietary code(you just can't sell or give away a modified binary only version of the library itself without reciprocation). While the core library is for implementing File Sharing, we can also use it for authentication using LDAP. The following are a sequence of steps to setup jCIFS for authentication:
  1. Download jCIFS from the site.
  2. The following three lines of code are enough to check authentication
    UniAddress uniaddress = UniAddress.getByName(LDAP_Host_Name);
    NtlmPasswordAuthentication ntlmpasswordauthentication = new NtlmPasswordAuthentication(domain, username, password);
    SmbSession.logon(uniaddress, ntlmpasswordauthentication);
  3. If the authentication fails, then the logon method throws an exception.
This type of authentication can also be achieved by using JNDI, jCIFS adds more to this, i.e. jCIFS supports NTLM authentication, i.e. users within the domain are not challenged for username and password (if using Internet Explorer, Firefox always prompts for password). This feature is similar to the SPNEGO TAI provided with WebSphere Application server. To know how to setup NTLM authentication with jCIFS, visit the JCIFS NTLM HTTP Authentication page.

Wednesday, August 02, 2006

Jad Decompiler Plug-in for Eclipse

JAD Eclipse is an eclipse plug-in for the JAD Decompiler. The following is a quick description of how to setup JAD Eclipse (assuming you already have eclipse setup).
  1. Download the latest version of JAD decompiler and set modify your path to add JAD_HOME directory.
  2. Download the latest version of JAD Eclipse from the link shown above and extract it to your eclipse plugins directory.
  3. Restart eclipse and configure JAD as follows
    1. In eclipse, go to - Window->Preferences->Java->JadClipse
    2. Set Path to decompiler to "jad" (jad is already in your path).Click Apply.
This is the basic setup for running JAD Eclipse. You will be able to look in to you library classes by simply clicking on the class file, or the class in the type hierarchy. If you are in the J2EE perspective, you can open up you jar files and look into those class files too. It is up to you to decide how you want to go. By the way, JAD eclipse also has a lot of additional customizations available, which can be seen under JAD Eclipse preferences in Eclipse.

Popular Posts