org.sape.carbon.services.ejb.remote
Class RemoteHomeFactoryImpl

java.lang.Object
  |
  +--org.sape.carbon.services.ejb.remote.RemoteHomeFactoryImpl
All Implemented Interfaces:
Configurable, FunctionalInterface, RemoteHomeFactory

public class RemoteHomeFactoryImpl
extends Object
implements Configurable, RemoteHomeFactory

The functional implementation of the Remote Home Factory functional interface.
The following list summarizes the key entites involved in using this servive

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

Field Summary
private  RemoteHomeFactoryConfiguration configuration
           
private  Map ejbMap
          A private Map object used to store the lookup details of EJBs associated with this home factory component
private static String EMPTY_STRING
          Used for performing comparisons/null-checks on configuration data
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
RemoteHomeFactoryImpl()
           
 
Method Summary
protected  void cacheHome(String logicalName, javax.ejb.EJBHome 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 XML configuration.
 javax.ejb.EJBHome lookup(String logicalName)
          Handles JNDI lookups for remotely deployed EJBs using the default context properties declared in the associated configuration.
 javax.ejb.EJBHome lookup(String logicalName, Context context)
          Handles JNDI lookups for remotely deployed EJBs using a context object specified at run-time.
 javax.ejb.EJBHome lookup(String logicalName, String principal, String credentials)
          Handles JNDI lookups for remotely 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


EMPTY_STRING

private static final String EMPTY_STRING
Used for performing comparisons/null-checks on configuration data

See Also:
Constant Field Values

configuration

private RemoteHomeFactoryConfiguration 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

RemoteHomeFactoryImpl

public RemoteHomeFactoryImpl()
Method Detail

lookup

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

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

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

lookup

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

Handles JNDI lookups for remotely 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 RemoteHomeFactory
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:
EJBHome The home interface object for the remote EJB
Throws:
HomeFactoryException - Wraps any checked exception that occurs during the JNDI lookup
See Also:
RemoteHomeFactory

lookup

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

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

Specified by:
lookup in interface RemoteHomeFactory
Parameters:
logicalName - a 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:
EJBHome The home interface object for the remote EJB
Throws:
HomeFactoryException - Wraps any checked exception that occurs during the JNDI lookup
See Also:
RemoteHomeFactory

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: RemoteHomeFactory

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

Specified by:
getEJBDetails in interface RemoteHomeFactory
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:
RemoteHomeFactory

cacheHome

protected void cacheHome(String logicalName,
                         javax.ejb.EJBHome 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 remotely deployed EJB


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.