public class ClientFactory<T extends java.rmi.Remote>
extends java.lang.Object
Constructor and Description |
---|
ClientFactory() |
Modifier and Type | Method and Description |
---|---|
static <T extends java.rmi.Remote> |
getInstance(java.lang.String agencyId,
java.lang.Class<T> clazz)
This serves as a factory class For a Remote object.
|
static <T extends java.rmi.Remote> |
getRmiStub(RmiStubInfo info,
boolean updateHostName)
Creates an RMI stub based on the project name, host name, and class name.
|
static int |
getTimeoutSec()
Returns the timeout time.
|
static void |
main(java.lang.String[] args)
Just for debugging.
|
public static <T extends java.rmi.Remote> T getInstance(java.lang.String agencyId, java.lang.Class<T> clazz)
host
- Where remote object livesagencyId
- For creating bind name for remote objectclazz
- Because this is a static method the only way to get the class
name is to pass in the class.public static <T extends java.rmi.Remote> T getRmiStub(RmiStubInfo info, boolean updateHostName) throws java.rmi.RemoteException, java.rmi.NotBoundException
info
- Species the agency ID and the host nameupdateHostName
- Indicates whether should update host name instead of just
getting old values from cache. Should update if there is a
problem in invoking an RMI call since perhaps the server for
an agency was moved to a new hostname. But when first creating
a client factory don't want to access db so should just use
cached value.java.rmi.RemoteException
java.rmi.NotBoundException
public static int getTimeoutSec()
public static void main(java.lang.String[] args)
args
-