|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bankframe.ejb.Server
This class provides utility methods for obtaining EJB Home references, and for
manipulating remote objects and enumerations.
This class can cache EJB Home interfaces if the ejb.cacheHomes=true
setting is specified in
BankframeResource.properties
.
If homes caching is defined then the Homes cache must be configured in BankframeResource.properties
as follows:
cache.homesCache.class=com.bankframe.services.cache.GenericCache
cache.homesCache.policy=com.bankframe.services.cache.LruCachePolicy
cache.homesCache.policy.maxSize=100
cache.homesCache.policy.thrashAmount=10
Nested Class Summary | |
static interface |
Server.UserToken
Deprecated. This interface is no longer required as an alternative method is used to cache the user token |
Field Summary | |
static java.lang.String |
ANONYMOUS_USER
|
static java.lang.String |
EJB_INITIALCONTEXTFACTORY
Flag in BankframeResource.properties indicating initial context factory to use |
static java.lang.String |
EJB_SERVER
Flag in BankframeResource.properties indicating which ejb server to use |
static java.lang.String |
ejbInitialContextFactory
|
static java.lang.String |
ejbServer
|
static java.lang.String |
HOME_CACHE
|
static java.lang.String |
JNDI_DEFAULT_PREFIX_VALUE
|
static java.lang.String |
JNDI_EJB_10
|
static java.lang.String |
JNDI_EJB_11
|
static java.lang.String |
JNDI_MODE_KEY
|
static java.lang.String |
JNDI_PREFIX
|
static java.lang.String |
jndiMode
|
static java.lang.String |
jndiPrefix
|
static java.lang.String |
USER_TOKEN
|
static java.lang.String |
USER_TOKEN_CLASS_NAME
|
Constructor Summary | |
Server()
|
Method Summary | |
static java.util.Enumeration |
enumFromVector(java.util.Vector v)
This method creates an Enumeration from a Vector that is Serializable. |
static java.lang.String |
getCurrentUserToken()
This method returns the user token for the currently authenticated user. |
static javax.naming.Context |
getInitialContext()
This method creates an initial context for an anonymous user. |
static java.lang.Object |
getObjectFromEnum(java.util.Enumeration enm,
java.lang.Class narrowTo)
This method retrieves a remote object from an enumeration, making sure it can be casted to the desired class. |
java.lang.Object |
lookup(javax.naming.Context ctx,
java.lang.String jndiName,
java.lang.Class beanHomeClass)
This method looks up the EJB Home for the specified EJB. |
static java.lang.Object |
lookup(javax.naming.Context ctx,
java.lang.String jndiName,
java.lang.Class beanHomeClass,
java.lang.String userToken)
Deprecated. The user token is no longer required when doing JNDI lookups |
static java.lang.Object |
lookup(java.lang.String jndiName,
java.lang.Class beanHomeClass)
This method looks up the EJB Home for the specified EJB. |
static java.lang.Object |
lookup(java.lang.String jndiName,
java.lang.Class beanHomeClass,
java.lang.String userToken)
Deprecated. The user token is no longer required when doing JNDI lookups |
static java.lang.Object |
lookup(java.lang.String jndiName,
java.lang.Class beanHomeClass,
java.lang.String userToken,
boolean forceCreate)
Deprecated. The user token is no longer required when doing JNDI lookups, A single initial context is shared between all threads, therefore there is no longer any way to force creation of a new context |
static void |
setCurrentUserToken(java.lang.String token)
This method sets the user token for the current thread |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String USER_TOKEN
public static final java.lang.String ANONYMOUS_USER
public static final java.lang.String USER_TOKEN_CLASS_NAME
public static final java.lang.String JNDI_MODE_KEY
public static final java.lang.String JNDI_EJB_10
public static final java.lang.String JNDI_EJB_11
public static final java.lang.String JNDI_PREFIX
public static final java.lang.String JNDI_DEFAULT_PREFIX_VALUE
public static final java.lang.String HOME_CACHE
public static final java.lang.String EJB_INITIALCONTEXTFACTORY
public static final java.lang.String EJB_SERVER
public static final java.lang.String ejbInitialContextFactory
public static final java.lang.String ejbServer
public static final java.lang.String jndiMode
public static final java.lang.String jndiPrefix
Constructor Detail |
public Server()
Method Detail |
public static java.util.Enumeration enumFromVector(java.util.Vector v)
v
- the vector to enumerate
public static void setCurrentUserToken(java.lang.String token)
token
- public static java.lang.String getCurrentUserToken()
public static javax.naming.Context getInitialContext() throws javax.naming.NamingException
javax.naming.NamingException
public static java.lang.Object getObjectFromEnum(java.util.Enumeration enm, java.lang.Class narrowTo) throws java.lang.ClassCastException
narrowTo
- is the Class type to narrow to.
java.lang.ClassCastException
- if the enumeration element can not be narrowed to the specified class typepublic static java.lang.Object lookup(java.lang.String jndiName, java.lang.Class beanHomeClass) throws ProcessingErrorException
jndiName
- The EJB's JNDI namebeanHomeClass
- The Home class that the returned object should be narrowed to
ProcessingErrorException
- if the lookup request failspublic static java.lang.Object lookup(java.lang.String jndiName, java.lang.Class beanHomeClass, java.lang.String userToken) throws ProcessingErrorException
jndiName
- The EJB's JNDI namebeanHomeClass
- The home class that the returned object should be narrowed touserToken
- The user token to authenticate as
ProcessingErrorException
- if the lookup request failspublic static java.lang.Object lookup(java.lang.String jndiName, java.lang.Class beanHomeClass, java.lang.String userToken, boolean forceCreate) throws ProcessingErrorException
jndiName
- The EJB's JNDI namebeanHomeClass
- The Home class that the returned object should be narrowed touserToken
- The user token to authenticate asforceCreate
- Create a new context true/false
ProcessingErrorException
- if the lookup request failspublic java.lang.Object lookup(javax.naming.Context ctx, java.lang.String jndiName, java.lang.Class beanHomeClass) throws ProcessingErrorException
ctx
- The initial context to usejndiName
- The EJB's JNDI namebeanHomeClass
- The Home class that the returned object should be narrowed to
ProcessingErrorException
- if the lookup request failspublic static java.lang.Object lookup(javax.naming.Context ctx, java.lang.String jndiName, java.lang.Class beanHomeClass, java.lang.String userToken) throws ProcessingErrorException
ctx
- The initial context to usejndiName
- The EJB's JNDI namebeanHomeClass
- The Home class that the returned object should be narrowed touserToken
- The user token
ProcessingErrorException
- if the lookup request fails
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |