KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > test > servicedependency > Customer


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.ejb3.test.servicedependency;
8
9 import java.util.Properties JavaDoc;
10
11 import javax.naming.InitialContext JavaDoc;
12 import javax.rmi.PortableRemoteObject JavaDoc;
13
14 /**
15  * A Customer.
16  *
17  * @author <a HREF="galder.zamarreno@jboss.com">Galder Zamarreno</a>
18  * @version $Revision: 44023 $
19  */

20 public class Customer
21 {
22
23    /**
24     * FIXME Comment this
25     *
26     * @param args
27     * @throws Exception
28     */

29    public static void main(String JavaDoc[] args) throws Exception JavaDoc
30    {
31       Properties JavaDoc props = new Properties JavaDoc();
32       props.setProperty("java.naming.factory.initial",
33                "org.jnp.interfaces.NamingContextFactory");
34       props.setProperty("java.naming.factory.url.pkgs",
35                "org.jboss.naming:org.jnp.interfaces");
36       props.setProperty("java.naming.provider.url", "localhost:1099");
37       
38       InitialContext JavaDoc ctx = new InitialContext JavaDoc(props);
39       
40       Object JavaDoc ejb= ctx.lookup("AccountBean/remote");
41       Account account = (Account)PortableRemoteObject.narrow(ejb, Account.class);
42       
43       account.debit("galder", 10);
44    }
45
46 }
47
Popular Tags