org.jboss.remoting.samples.detection.jndi
Class SimpleDetectorServer

java.lang.Object
  extended by org.jboss.remoting.samples.detection.jndi.SimpleDetectorServer
Direct Known Subclasses:
SimpleSSLDetectorServer

public class SimpleDetectorServer
extends java.lang.Object

A simple JBoss/Remoting remoting server. This uses an inner class SampleInvocationHandler as the invocation target handler class.

Author:
Tom Elrod, John Mazzitelli

Nested Class Summary
static class SimpleDetectorServer.SampleInvocationHandler
          Simple invocation handler implementation.
 
Field Summary
protected static java.lang.String host
           
protected static int port
           
protected static java.lang.String transport
           
 
Constructor Summary
SimpleDetectorServer()
           
 
Method Summary
protected  java.util.Map getConfiguration()
           
protected  SimpleDetectorServer getDetectorServer()
           
protected static java.lang.String getLocatorURI(java.lang.String[] args)
           
static void main(java.lang.String[] args)
          Can pass transport and port to be used as parameters.
static void println(java.lang.String msg)
          Outputs a message to stdout.
 void setupDetector()
          Sets up NetworkRegistry and JNDItDetector so will can register ourselves on the network.
 void setupServer(java.lang.String locatorURI)
          Sets up our JBoss/Remoting server by creating our Connector on the given locator URI and installing our invocation handler that will handle incoming messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transport

protected static java.lang.String transport

host

protected static java.lang.String host

port

protected static int port
Constructor Detail

SimpleDetectorServer

public SimpleDetectorServer()
Method Detail

setupDetector

public void setupDetector()
                   throws java.lang.Exception
Sets up NetworkRegistry and JNDItDetector so will can register ourselves on the network. We could also use these to listen ourselves for any additions or removals of remoting servers on the network.

Throws:
java.lang.Exception

setupServer

public void setupServer(java.lang.String locatorURI)
                 throws java.lang.Exception
Sets up our JBoss/Remoting server by creating our Connector on the given locator URI and installing our invocation handler that will handle incoming messages.

Parameters:
locatorURI - defines our server endpoing
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
Can pass transport and port to be used as parameters. Valid transports are 'rmi' and 'socket'.

Parameters:
args - transport and port number

println

public static void println(java.lang.String msg)
Outputs a message to stdout.

Parameters:
msg - the message to output

getLocatorURI

protected static java.lang.String getLocatorURI(java.lang.String[] args)

getConfiguration

protected java.util.Map getConfiguration()
Returns:
configuration map for Connector and JNDIDetector

getDetectorServer

protected SimpleDetectorServer getDetectorServer()


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.