KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > stateless_deployment_descriptor > client > Client


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.tutorial.stateless_deployment_descriptor.client;
8
9 import org.jboss.tutorial.stateless_deployment_descriptor.bean.Calculator;
10 import org.jboss.tutorial.stateless_deployment_descriptor.bean.CalculatorRemote;
11
12 import javax.naming.InitialContext JavaDoc;
13
14 public class Client
15 {
16    public static void main(String JavaDoc[] args) throws Exception JavaDoc
17    {
18       InitialContext JavaDoc ctx = new InitialContext JavaDoc();
19       Calculator calculator = (Calculator) ctx.lookup(CalculatorRemote.class.getName());
20
21       System.out.println("1 + 1 = " + calculator.add(1, 1));
22       System.out.println("1 - 1 = " + calculator.subtract(1, 1));
23    }
24 }
25
Popular Tags