Package

Source Code of ConfirmerClient

/*
*
* Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the proprietary information of Sun Microsystems, Inc. 
* Use is subject to license terms.
*
*/

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

import Confirmer;
import ConfirmerHome;

public class ConfirmerClient {

   public static void main(String[] args) {
       try {
           String recipient = "murphy@cloverave.com";

           Context initial = new InitialContext();
           Object objref = initial.lookup("java:comp/env/ejb/SimpleConfirmer");

           ConfirmerHome home =
               (ConfirmerHome)PortableRemoteObject.narrow(objref,
                                            ConfirmerHome.class);

           Confirmer confirmer = home.create();
           confirmer.sendNotice(recipient);

           System.exit(0);

       } catch (Exception ex) {
           System.err.println("Caught an unexpected exception!");
           ex.printStackTrace();
       }
   }
TOP

Related Classes of ConfirmerClient

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.