/*
 * Generated file - Do not edit!
 */
package com.alodar.example.interfaces;

import java.lang.*;

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

import java.util.Hashtable;

/**
 * Utility class for Address.
 * @author XDOCLET 1.1.2
 * @xdoclet-generated at Aug 25, 2002 3:02:30 PM
 */
public class AddressUtil
{
   // Home interface lookup methods

   /**
    * Obtain remote home interface from default initial context
    * @return Home interface for Address. Lookup using JNDI_NAME
    */
   public static com.alodar.example.interfaces.AddressHome getHome() throws NamingException
   {
      InitialContext initialContext = new InitialContext();
      try {
         java.lang.Object objRef = initialContext.lookup(com.alodar.example.interfaces.AddressHome.JNDI_NAME);
         com.alodar.example.interfaces.AddressHome home = (com.alodar.example.interfaces.AddressHome)PortableRemoteObject.narrow(objRef, com.alodar.example.interfaces.AddressHome.class);
         return home;
      } finally {
         initialContext.close();
      }
   }

   /**
    * Obtain remote home interface from parameterised initial context
    * @param environment Parameters to use for creating initial context
    * @return Home interface for Address. Lookup using JNDI_NAME
    */
   public static com.alodar.example.interfaces.AddressHome getHome( Hashtable environment ) throws NamingException
   {
      InitialContext initialContext = new InitialContext(environment);
      try {
         java.lang.Object objRef = initialContext.lookup(com.alodar.example.interfaces.AddressHome.JNDI_NAME);
         com.alodar.example.interfaces.AddressHome home = (com.alodar.example.interfaces.AddressHome)PortableRemoteObject.narrow(objRef, com.alodar.example.interfaces.AddressHome.class);
         return home;
      } finally {
         initialContext.close();
      }
   }

   /**
    * Obtain local home interface from default initial context
    * @return Local home interface for Address. Lookup using JNDI_NAME
    */
   public static com.alodar.example.interfaces.AddressLocalHome getLocalHome() throws NamingException
   {
      InitialContext initialContext = new InitialContext();
      try {
         // Local homes shouldn't be narrowed, as there is no RMI involved.
         com.alodar.example.interfaces.AddressLocalHome localHome = (com.alodar.example.interfaces.AddressLocalHome) initialContext.lookup(com.alodar.example.interfaces.AddressLocalHome.JNDI_NAME);
         return localHome;
      } finally {
         initialContext.close();
      }
   }

}