com.objectwave.configuration.bean
Class EjbPropertyLookup

java.lang.Object
  |
  +--com.objectwave.configuration.bean.EjbPropertyLookup
All Implemented Interfaces:
CreationStrategy

public class EjbPropertyLookup
extends java.lang.Object
implements CreationStrategy

Attempt to find configuration property values from a ConfigurationService enterprise bean. By default it will look for a bean called "/ejb/ConfigurationService", but this can be changed by setting an enviroment entry in a deployment descriptor. The environment property is "ConfigurationServiceName". The value found (if any) will be the complete JNDI name used to find the configuration service.

Version:
$Id: EjbPropertyLookup.java,v 2.1 2001/12/21 20:27:54 dave_hoag Exp $
Author:
dhoag

Nested Class Summary
 class EjbPropertyLookup.FakeProperty
          An object that pretends to be a Properties object.
 
Field Summary
static java.lang.String ejbConfigServiceJndiName
          Access ejb locally java:comp/env/ejb/ConfigurationService
static java.lang.String ejbConfigServicePropertyName
           
 
Constructor Summary
EjbPropertyLookup()
          Constructor for the EjbPropertyLookup object
 
Method Summary
 ConfigurationServiceHome getConfigurationServiceHome()
          Attempt to locate the central Enterprise ConfigurationService home.
 javax.naming.Context getContext()
          Gets the Context attribute of the FakeProperty object
 java.util.Properties getOrCreateProperties(java.lang.String categoryId, java.lang.Object context)
          Return an new 'Property' object that will query the ConfigurationService enterprise bean for property values.
 void initServiceHome()
          Use JNDI to locate the ConfigurationService enterprise bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ejbConfigServiceJndiName

public static final java.lang.String ejbConfigServiceJndiName
Access ejb locally java:comp/env/ejb/ConfigurationService

See Also:
Constant Field Values

ejbConfigServicePropertyName

public static final java.lang.String ejbConfigServicePropertyName
See Also:
Constant Field Values
Constructor Detail

EjbPropertyLookup

public EjbPropertyLookup()
Constructor for the EjbPropertyLookup object

Method Detail

getConfigurationServiceHome

public ConfigurationServiceHome getConfigurationServiceHome()
                                                     throws javax.naming.NamingException
Attempt to locate the central Enterprise ConfigurationService home.

Returns:
The ConfigurationServiceHome value
Throws:
javax.naming.NamingException

getOrCreateProperties

public java.util.Properties getOrCreateProperties(java.lang.String categoryId,
                                                  java.lang.Object context)
Return an new 'Property' object that will query the ConfigurationService enterprise bean for property values.

Specified by:
getOrCreateProperties in interface CreationStrategy
Parameters:
categoryId -
context -
Returns:
The OrCreateProperties value

getContext

public javax.naming.Context getContext()
                                throws javax.naming.NamingException
Gets the Context attribute of the FakeProperty object

Returns:
The Context value
Throws:
javax.naming.NamingException

initServiceHome

public void initServiceHome()
                     throws javax.naming.NamingException
Use JNDI to locate the ConfigurationService enterprise bean. The JNDI name is either configured by the ConfigurationServiceName env-entry in the deployment descriptor, or a default value.

Throws:
javax.naming.NamingException