edu.cmu.mafia.NamingService
Class EJBFactory
java.lang.Object
edu.cmu.mafia.NamingService.EJBFactory
public class EJBFactory
- extends java.lang.Object
This class is a utility to get a EJB object from JNDI.
Method Summary |
protected static java.lang.Object |
failover(java.lang.String machine)
returns next available refernce. |
static java.lang.Object |
getEJBHome(java.lang.String name)
The getEJBHome() takes in the name of an EJB object
and returns its home interface |
static javax.naming.InitialContext |
getInitialContext()
The getInitialContext() method returns an EJB InitialContext
which points to the current primary server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TIMEOUT
protected static final int TIMEOUT
- See Also:
- Constant Field Values
DEFAULT_SERVER
protected static final java.lang.String DEFAULT_SERVER
- See Also:
- Constant Field Values
CURRENT_SERVER
protected static java.lang.String CURRENT_SERVER
EJBFactory
public EJBFactory()
getInitialContext
public static javax.naming.InitialContext getInitialContext()
throws javax.naming.NamingException
- The getInitialContext() method returns an EJB InitialContext
which points to the current primary server. This method
accomplishes this by querying the replication manager, which
manages the list of servers in the replica group.
- Returns:
- the InitialContext which points to the current primary server
- Throws:
javax.naming.NamingException
getEJBHome
public static java.lang.Object getEJBHome(java.lang.String name)
- The getEJBHome() takes in the name of an EJB object
and returns its home interface
- Parameters:
name
- A string cotaining the name of the EJB object
- Returns:
- an EJBHome object given its name.
failover
protected static java.lang.Object failover(java.lang.String machine)
- returns next available refernce.
Copyright (c) 2006 FaultTerminators. All Rights Reserved.