org.sape.carbon.services.ejb.local
Class LocalHomeFactoryImpl

java.lang.Object
  |
  +--org.sape.carbon.services.ejb.local.LocalHomeFactoryImpl
All Implemented Interfaces:
Configurable, FunctionalInterface, LocalHomeFactory

public class LocalHomeFactoryImpl
extends Object
implements Configurable, LocalHomeFactory

The implementation of the Local Home Factory
The following list summarizes the key entites involved in using this service

Since:
carbon 1.0
Version:
$Revision: 1.15 $($Author: dvoet $ / $Date: 2003/11/05 17:45:16 $)
Author:
Erik M Gottesman, June 2002
See Also:
HomeFactoryConfiguration, LocalHomeFactory, EnterpriseBeanConfiguration

Field Summary
private  HomeFactoryConfiguration configuration
           
private  Map ejbMap
          A private Map object used to store the lookup details of EJBs associated with this home factory component
private  Map homeCache
          A private Map object used for caching the home interfaces of EJBs associated with this home factory component
private  org.apache.commons.logging.Log log
          Provides a handle to Apache-commons logger
 
Constructor Summary
LocalHomeFactoryImpl()
           
 
Method Summary
protected  void cacheHome(String logicalName, javax.ejb.EJBLocalHome ejbHome)
          Associates the home interface object of a locally deployed EJB with a logical name (usually its JNDI name), and caches it to decrease the cost of subsequent JNDI lookups
 void configure(ComponentConfiguration configuration)
          Configures the component.
 EnterpriseBeanConfiguration getEJBDetails(String logicalName)
          Utility method for retrieving an EJB's configuration information as declared in the associated configuration.
 javax.ejb.EJBLocalHome lookup(String logicalName)
          Handles JNDI lookups for locally deployed EJBs using the default context properties declared in the associated configuration.
 javax.ejb.EJBLocalHome lookup(String logicalName, Context context)
          Handles JNDI lookups for locally deployed EJBs using a context object specified at run-time.
 javax.ejb.EJBLocalHome lookup(String logicalName, String principal, String credentials)
          Handles JNDI lookups for locally deployed EJBs using the default context properties declared in the associated configuration with the exception of the security principal and credentials which are passed at run-time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private org.apache.commons.logging.Log log
Provides a handle to Apache-commons logger


configuration

private HomeFactoryConfiguration configuration

ejbMap

private Map ejbMap
A private Map object used to store the lookup details of EJBs associated with this home factory component


homeCache

private Map homeCache
A private Map object used for caching the home interfaces of EJBs associated with this home factory component

Constructor Detail

LocalHomeFactoryImpl

public LocalHomeFactoryImpl()
Method Detail

lookup

public javax.ejb.EJBLocalHome lookup(String logicalName)
                              throws HomeFactoryException
Description copied from interface: LocalHomeFactory

Handles JNDI lookups for locally deployed EJBs using the default context properties declared in the associated configuration.

Specified by:
lookup in interface LocalHomeFactory
Parameters:
logicalName - String representation of the EJB's logical name in JNDI
Returns:
EJBLocalHome The home interface object for the local EJB
Throws:
HomeFactoryException - Wraps any checked exception that occurs during the JNDI lookup
See Also:
LocalHomeFactory

lookup

public javax.ejb.EJBLocalHome lookup(String logicalName,
                                     String principal,
                                     String credentials)
                              throws HomeFactoryException
Description copied from interface: LocalHomeFactory

Handles JNDI lookups for locally deployed EJBs using the default context properties declared in the associated configuration with the exception of the security principal and credentials which are passed at run-time.

Specified by:
lookup in interface LocalHomeFactory
Parameters:
logicalName - a String representation of the EJB's logical name in JNDI
principal - String representation of the security principal
credentials - The credentials associated with the security principal in String format
Returns:
EJBLocalHome The home interface object for the local EJB
Throws:
HomeFactoryException - Wraps any checked exception that occurs during the JNDI lookup
See Also:
LocalHomeFactory

lookup

public javax.ejb.EJBLocalHome lookup(String logicalName,
                                     Context context)
                              throws HomeFactoryException
Description copied from interface: LocalHomeFactory

Handles JNDI lookups for locally deployed EJBs using a context object specified at run-time.

Specified by:
lookup in interface LocalHomeFactory
Parameters:
logicalName - String representation of the EJB's logical name in JNDI
context - A javax.naming.Context object to be used in performing the JNDI lookup
Returns:
EJBLocalHome The home interface object for the local EJB
Throws:
HomeFactoryException - Wraps any checked exception that occurs during the JNDI lookup
See Also:
LocalHomeFactory

configure

public void configure(ComponentConfiguration configuration)
Configures the component. This is preceded and followed by the suspend and resume operations if they are available on the component.

Specified by:
configure in interface Configurable
Parameters:
configuration - A HomeFactoryConfiguration instance

getEJBDetails

public EnterpriseBeanConfiguration getEJBDetails(String logicalName)
Description copied from interface: LocalHomeFactory

Utility method for retrieving an EJB's configuration information as declared in the associated configuration.

Specified by:
getEJBDetails in interface LocalHomeFactory
Parameters:
logicalName - String representation of the EJB's logical name in JNDI
Returns:
EnterpriseBeanConfiguration An encapsulation of the EJB's declared configuration details
See Also:
LocalHomeFactory

cacheHome

protected void cacheHome(String logicalName,
                         javax.ejb.EJBLocalHome ejbHome)

Associates the home interface object of a locally deployed EJB with a logical name (usually its JNDI name), and caches it to decrease the cost of subsequent JNDI lookups

Parameters:
logicalName - a String representation of the EJB's logical name in JNDI
ejbHome - the home interface object of a locally deployed EJB


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.