org.openpermis.examples.ejb.client
Class HelloWorldCLClient

java.lang.Object
  extended by org.openpermis.examples.ejb.client.HelloWorldCLClient

public final class HelloWorldCLClient
extends Object

Java client that can be invoked from the command line.

The client uses the configured naming context and tries to access the hello world service from the EJB name passed on the command line. (The name at which the EJB is registered at the naming context usually corresponds to the EAR name when deploying to a EJB3 container.)

The rest of this client deals with a simple user interface.

For the sake of simplicity error handling is very simple

Since:
0.4.0

Field Summary
private static String SERVICE
          The service context location.
private static String[] USER_CHOICES
          The users used.
 
Constructor Summary
private HelloWorldCLClient()
          Objects of this class cannot be instantiated.
 
Method Summary
static HelloWorldServiceRemote createService(String ejbName)
          Creates the HelloWorldServiceRemote.
static void main(String[] args)
          Starts the hello world EJB client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE

private static final String SERVICE
The service context location.

Constant Field Value:
"/HelloWorldService/remote"
Since:
0.4.0

USER_CHOICES

private static final String[] USER_CHOICES
The users used.

Since:
0.4.0
Constructor Detail

HelloWorldCLClient

private HelloWorldCLClient()
Objects of this class cannot be instantiated.

Since:
0.4.0
Method Detail

main

public static void main(String[] args)
Starts the hello world EJB client.

Pass the name of the EJB as the first argument to the client.

Parameters:
args - the application arguments containing the EJB name as the first argument.
Since:
new

createService

public static HelloWorldServiceRemote createService(String ejbName)
                                             throws NamingException
Creates the HelloWorldServiceRemote.

Parameters:
ejbName - the name of the ejb.
Returns:
the HelloWorld service.
Throws:
NamingException - if name could not be resolved.
Since:
0.4.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:52
Copyright (c) 2002-2007 Ergon Informatik AG