org.openpermis.examples.ejb.client
Class HelloEjbCLClient

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

public final class HelloEjbCLClient
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 HelloEjbCLClient()
          Objects of this class cannot be instantiated.
 
Method Summary
static HelloEjbServiceRemote createService(String ejbName)
          Creates the HelloEjbServiceRemote.
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:
"/AuthorizedHelloEjbService/remote"
Since:
0.4.0

USER_CHOICES

private static final String[] USER_CHOICES
The users used.

Since:
0.4.0
Constructor Detail

HelloEjbCLClient

private HelloEjbCLClient()
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 HelloEjbServiceRemote createService(String ejbName)
                                           throws NamingException
Creates the HelloEjbServiceRemote.

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


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:18:17
Copyright (c) 2002-2007 Ergon Informatik AG