org.apache.commons.ssl.rmi
Class Test

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

public class Test
extends java.lang.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 java.lang.String TEST_DATE_NAME
           
private static java.lang.String TEST_INT_NAME
           
protected static java.lang.String URL
           
 
Constructor Summary
Test()
           
 
Method Summary
static java.lang.Object lookup(java.lang.String ref)
          

JNDI/RMI lookup wrapper.

static void main(java.lang.String[] args)
           
static void rebind(java.lang.String ref, java.rmi.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 java.lang.String TEST_DATE_NAME
See Also:
Constant Field Values

TEST_INT_NAME

private static final java.lang.String TEST_INT_NAME
See Also:
Constant Field Values

PORT

protected static final int PORT

URL

protected static final java.lang.String URL

rmiRunning

private static boolean rmiRunning
Constructor Detail

Test

public Test()
Method Detail

lookup

public static java.lang.Object lookup(java.lang.String ref)
                               throws java.rmi.RemoteException,
                                      java.rmi.NotBoundException,
                                      java.net.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:
java.rmi.RemoteException - rmi problem
java.rmi.NotBoundException - rmi problem
java.net.MalformedURLException - rmi problem

rebind

public static void rebind(java.lang.String ref,
                          java.rmi.Remote obj)
                   throws java.rmi.RemoteException,
                          java.net.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:
java.rmi.RemoteException - rmi problem
java.net.MalformedURLException - rmi problem

rebindTest

private static void rebindTest()
                        throws java.lang.Exception
Throws:
java.lang.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(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception