org.apache.openejb.client
Class GenericServiceLocator
java.lang.Object
org.apache.openejb.client.ServiceLocator
org.apache.openejb.client.GenericServiceLocator
public class GenericServiceLocator
- extends ServiceLocator
- Version:
- $Rev: 607077 $ $Date: 2007-12-27 15:55:23 +0100 (Do, 27. Dez 2007) $
Constructor Summary |
GenericServiceLocator(javax.naming.Context context,
java.lang.String commonPrefix)
|
GenericServiceLocator(java.net.URI serverUri,
java.lang.String commonPrefix)
|
GenericServiceLocator(java.net.URI serverUri,
java.lang.String username,
java.lang.String password,
java.lang.String commonPrefix)
|
GenericServiceLocator(java.net.URI serverUri,
java.lang.String username,
java.lang.String password,
java.lang.String realm,
java.lang.String commonPrefix)
|
Method Summary |
|
lookup(java.lang.Class<T> type)
Usable with JNDI name formats ending in the full class name of the interface
Such as:
- {interfaceClass}
Or with commonPrefix (supplied in constructor) such as:
- {moduleId}/{interfaceClass}
- ejb/{moduleId}/{interfaceClass} |
|
lookup(java.lang.Class<T> type,
java.lang.Class<B> ejbClass)
Usable with JNDI name formats comprised of the interfaceClass and ejbClass
For variation, the interface class is the prefix and the ejb class is the
suffix. |
java.lang.Object |
lookup(java.lang.String name)
|
|
lookup(java.lang.String prefix,
java.lang.Class<T> type)
Usable with JNDI name formats including a varying prefix such as ejbName or deploymentID
and ending in the full class name of the interface
Such as:
- {ejbName}/{interfaceClass}
- {deploymentId}/{interfaceClass}
Or with commonPrefix (supplied in constructor) such as:
- {moduleId}/{ejbName}/{interfaceClass}
- ejb/{moduleId}/{deploymentId}/{interfaceClass} |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericServiceLocator
public GenericServiceLocator(java.net.URI serverUri,
java.lang.String commonPrefix)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
GenericServiceLocator
public GenericServiceLocator(java.net.URI serverUri,
java.lang.String username,
java.lang.String password,
java.lang.String commonPrefix)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
GenericServiceLocator
public GenericServiceLocator(java.net.URI serverUri,
java.lang.String username,
java.lang.String password,
java.lang.String realm,
java.lang.String commonPrefix)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
GenericServiceLocator
public GenericServiceLocator(javax.naming.Context context,
java.lang.String commonPrefix)
lookup
public java.lang.Object lookup(java.lang.String name)
- Overrides:
lookup
in class ServiceLocator
lookup
public <T> T lookup(java.lang.Class<T> type)
- Usable with JNDI name formats ending in the full class name of the interface
Such as:
- {interfaceClass}
Or with commonPrefix (supplied in constructor) such as:
- {moduleId}/{interfaceClass}
- ejb/{moduleId}/{interfaceClass}
- Parameters:
type
- the interfaceClass
- Returns:
- (T) lookup(type.getName())
lookup
public <T> T lookup(java.lang.String prefix,
java.lang.Class<T> type)
- Usable with JNDI name formats including a varying prefix such as ejbName or deploymentID
and ending in the full class name of the interface
Such as:
- {ejbName}/{interfaceClass}
- {deploymentId}/{interfaceClass}
Or with commonPrefix (supplied in constructor) such as:
- {moduleId}/{ejbName}/{interfaceClass}
- ejb/{moduleId}/{deploymentId}/{interfaceClass}
- Parameters:
prefix
- such as ejbName or deploymentIdtype
- the interfaceClass
- Returns:
- (T) lookup(prefix + "/" + type.getName())
lookup
public <T,B> T lookup(java.lang.Class<T> type,
java.lang.Class<B> ejbClass)
- Usable with JNDI name formats comprised of the interfaceClass and ejbClass
For variation, the interface class is the prefix and the ejb class is the
suffix. This is neat as the the prefix (the interface class name) becomes
a jndi context with one binding in it for each implementing ejb class.
Works with:
- {interfaceClass}/{ejbClass}
Or with commonPrefix (supplied in constructor) such as:
- {moduleId}/{interfaceClass}/{ejbClass}
- ejb/{moduleId}/{interfaceClass}/{ejbClass}
- Parameters:
type
- the interfaceClassejbClass
- the ejbClass
- Returns:
- (T) lookup(type.getName() + "/" + ejbClass.getName())
Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.