KickJava   Java API By Example, From Geeks To Geeks.

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