org.apache.commons.ssl.rmi
Class Test

java.lang.Object
  extended by org.apache.commons.ssl.rmi.Test

public class Test
extends Object

Since:
22-Feb-2007
Author:
Credit Union Central of British Columbia, www.cucbc.com, juliusdavies@cucbc.com

Field Summary
private static LogWrapper log
           
protected static int PORT
           
private static boolean rmiRunning
           
private static String TEST_DATE_NAME
           
private static String TEST_INT_NAME
           
protected static String URL
           
 
Constructor Summary
Test()
           
 
Method Summary
static Object lookup(String ref)
          

JNDI/RMI lookup wrapper.

static void main(String[] args)
           
static void rebind(String ref, Remote obj)
          

JNDI/RMI rebind wrapper for the UCS.

private static void rebindTest()
           
private static void requireNameServer()
          

Attempts to start a naming server on the localhost if one is not already running.

static void tryToStartNameServer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final LogWrapper log

TEST_DATE_NAME

private static final String TEST_DATE_NAME
See Also:
Constant Field Values

TEST_INT_NAME

private static final String TEST_INT_NAME
See Also:
Constant Field Values

PORT

protected static final int PORT

URL

protected static final String URL

rmiRunning

private static boolean rmiRunning
Constructor Detail

Test

public Test()
Method Detail

lookup

public static Object lookup(String ref)
                     throws RemoteException,
                            NotBoundException,
                            MalformedURLException

JNDI/RMI lookup wrapper. Appends "java:" if we expect binding/lookup to occur in the same JVM. Otherwise, appends "rmi:".

Parameters:
ref - String reference.
Returns:
Object Object previously bound with String reference.
Throws:
RemoteException - rmi problem
NotBoundException - rmi problem
MalformedURLException - rmi problem

rebind

public static void rebind(String ref,
                          Remote obj)
                   throws RemoteException,
                          MalformedURLException

JNDI/RMI rebind wrapper for the UCS. Appends "java:" if we expect binding/lookup to occur in the same JVM. Otherwise, append "rmi:".

Also attempts to start a naming server on the localhost if one is not already running. Currently we use RMI.

Parameters:
ref - String reference to bind with.
obj - Object to bind.
Throws:
RemoteException - rmi problem
MalformedURLException - rmi problem

rebindTest

private static void rebindTest()
                        throws Exception
Throws:
Exception

requireNameServer

private static void requireNameServer()

Attempts to start a naming server on the localhost if one is not already running.


tryToStartNameServer

public static void tryToStartNameServer()

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception