Thin application clients

 

+

Search Tips   |   Advanced Search

 

The Thin application client provides a lightweight, downloadable Java application run time capable of interacting with enterprise beans.

WAS supports the pluggable client.

The Thin application client is designed to support those users who want a lightweight Java client application programming environment, without the overhead of the J2EE platform on the client machine. The programming model for this client is heavily influenced by the CORBA programming model, but supports access to enterprise beans.

When accessing enterprise beans from this client, the client application can consider the enterprise beans object references as CORBA object references.

Tooling does not exist on the client, it exists on the server. You are responsible for...

The Thin application client provides the necessary runtime to support the communication needs between the client and the server.

The Thin application client uses the RMI-IIOP protocol. Using this protocol enables the client application to access not only enterprise bean references and CORBA object references, but also allows the client application to use any supported CORBA services. Using the RMI-IIOP protocol along with the accessibility of CORBA services can assist a user in developing a client application that needs to access both enterprise bean references and CORBA object references.

When you combine the J2EE and CORBA environments in one client application, understand the differences between the two programming models, to use and manage each appropriately.

The Thin application client run time provides the necessary support for the client application for object resolution, security, Reliability Availability and Servicability (RAS), and other services. However, this client does not support a container that provides easy access to these services.

For example, no support exists for using nicknames for enterprise beans or local resource resolution. When resolving to an enterprise bean (using either JNDI or CosNaming) sources, the client application must know the location of the name server and the fully qualified name used when the reference was bound into the name space. When resolving to a local resource, the client application cannot resolve to the resource through a JNDI lookup. Instead the client application must explicitly create the connection to the resource using the appropriate API (JDBC, JMS, and so on).

This client does not perform initialization of any of the services that the client application might require. For example, the client application is responsible for the initialization of the naming service, either through CosNaming or JNDI APIs.

The Thin application client offers access to most of the available client services in the J2EE application client. However, you cannot access the services in the thin client as as you can in the J2EE application client. The J2EE client has the advantage of performing a simple JNDI name space lookup to access the desired service or resource. The thin client must code explicitly for each resource in the client application. For example, looking up an enterprise bean Home requires the following code in a J2EE application client:

 java.lang.Object ejbHome =  initialContext.lookup("java:/comp/env/ejb/MyEJBHome");

MyEJBHome = (MyEJBHome)javax.rmi.PortableRemoteObject.narrow(ejbHome,  MyEJBHome.class);

However, we need more explicit code in a Thin application client:

 java.lang.Object ejbHome =  
  initialContext.lookup("the/fully/qualified/path/to/actual/home/in/namespace/MyEJBHome");

MyEJBHome = (MyEJBHome)javax.rmi.PortableRemoteObject.narrow(ejbHome,  MyEJBHome.class);

In this example, the J2EE application client accesses a logical name from the java:/comp name space. The J2EE client run time resolves that name to the physical location and returns the reference to the client application. The Thin application client must know the fully qualified physical location of the enterprise bean Home in the name space. If this location changes, the thin client application must also change the value placed on the lookup() statement.

In the J2EE client, the client application is protected from these changes because it uses the logical name. A change might require a redeployment of the EAR file, but the actual client application code remains the same.

The Thin application client is a traditional Java application that contains a main function. The WebSphere Thin application client provides run-time support for accessing remote enterprise beans, and provides the implementation for various services. This client can also access CORBA objects and CORBA based services. When using both environments in one client application, understand the differences between the enterprise bean and CORBA programming models to manage both environments.

For instance, the CORBA programming model requires the CORBA CosNaming name service for object resolution in a name space. The enterprise beans programming model requires the JNDI name service. The client application must initialize and properly manage these two naming services.

Another difference applies to the enterprise bean model. Use the JNDI implementation in the enterprise bean model to initialize the Object Request Broker (ORB). The client application is unaware that an ORB is present. The CORBA model, however, requires the client application to explicitly initialize the ORB through the ORB.init() static method.

The Thin application client provides a batch command used to to set the CLASSPATH and JAVA_HOME environment variables to enable the Thin application client run time.

WAS V6.1 and the Application client for WAS V6.1 also provides specialized types of Thin application client. The Web Services Thin Client is an unmanaged, stand-alone Java client environment that allows you to run JAX-RPC Web services client applications to invoke Web services that are hosted by the appserver. The Administration Thin Client enables client applications to perform administration tasks outside of the appserver environment.


 

Related tasks

Running Thin application client code
Running an unmanaged Web services JAX-RPC client
Use the Administration Thin Client