cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

EJB Components and WebServices UI Specification

This document specifies the UI for creation and management of individual Enterprise Beans and Web Services.

Author: Ann Sunhachawee, Jiri Kopsa, Jan Rojcek

$Revision: 1.2 $
$Date: 2005/04/25 15:17:16 $

Table of Contents:

Tasks

The tasks to be supported:

  1. Understand what type of EJB that best fits the problem
  2. Create EJBs
    1. Session Beans (Stateless or Stateful, Bean Managed or Container Managed Transaction, Remote and/or Local)
      1. Specify Stateful v Stateless (if Stateful, may need to add more details)
      2. Provide a name for EJB (could be used for both ejb-name and base of file names)
      3. View/edit the associated files (implementation, interfaces, home)
      4. Specify the package for files
      5. Specify different packages for impl vs interface (?)
      6. Rename EJB
    2. CMP Entity Bean from Database Connection / DB Schema (decide if this is the same or offer both wizards?)
    3. CMP Entity Beans from a Database (collection of CMPs)
    4. CMP Entity Bean from scratch (to support J2EE1.4 ability to create mapping and table on the fly)
    5. Message Driven Bean
    6. BMP (less important)
  3. Add/Remove appropriate methods and fields to EJBs
    1. e.g. for all EJBs : Business Methods and Create Methods
    2. for CMPs: additionally Finder Methods, Home Methods, Select Methods, CMP fields, CMR relationships
  4. Specify existing methods in the Bean Class as a Business Method, Create Method, etc
  5. View and configure deployment info of individual EJB
    1. //Needs more details
  6. Refactoring all necessary files within EJB (including deployment descriptors)
  7. Expose a stateless session bean as a web service
  8. Use an existing web service
  9. Call Entity Bean from a Session Bean
  10. Copy/Paste EJBs to duplicate funcationality and start at a "baseline"

New File Wizard

New Enterpise Bean Wizards are used for creating a new bean within an EJB Module Project. Creating a new bean will add the appropriate skeleton files and modify the appropriate configuration files in the EJB Module project. It can also add server resources if needed (discussed later).

Step 1: Choose File Type

Figure: File Type categories in EJB Module Project

Enterprise
Session Bean
Entity Bean
CMP Entity Beans from Database
Message-Driven Bean
Service Locator
Caching Service Locator
Java Classes
JavaBeans Objects
JUnit
Web Services
Web Service
Web Service from WSDL
Web Service Client
Message Handler
Databases
Database Schema
Server Resources
JDBC Connection Pool
JDBC Resource
JMS Resource
JavaMail Resource
Persistance Resource
XML
Ant Build Scripts
Other

Step 2: New Session Bean - Name and Location

This wizard creates a new Session Bean, generates several files, fills the bean implementation class with some template code and adds records to deployment descriptors.

Figure: Name and Location of

+---------------------------------------------------------------------------------+
| New Session Bean |
+---------------------------------------------------------------------------------+
| Name and Location |
| ------------------------------------------------------------------------------- |
| |
| EJB Name: |_SessionBean_______________________________________________________| |
| |
| Project: |_Module6Ejb________________________________________________________| |
| Location: |_Source Packages__________________________________________________v| |
| Package: |_com.acme_________________________________________________________v| |
| |
| ------------------------------------------------------------------------------- |
| |
| Session Type: |
| (o) Stateless |
| ( ) Stateful |
| |
| Create Interface: |
| [x] Remote |
| [ ] Local |
| |
| |
| |
+---------------------------------------------------------------------------------+
Components:
  • EJB Name text field - contains default value "NewSession" - when changed, a default Display Name is generated
  • Display Name text field - according to Blueprint naming conventions, the naming is genereated from the EJB Name, however it can be changed by the user
  • Project, Location, Package - same behaviour as in New Java Class Wizard
  • Create Interface checkboxes - Remote selected by default
  • Session Type radio buttons - Stateless selected by default

Inline errors:

  • EJB Name is required!
  • EJB Name has to be a valid Java identifier.
  • same Java error message -  "Warning: As of JDK1.4, it is highly recommended that you do NOT place Java classes in the default package"

Upon finishing the wizard:

  • Creates several Java files - Bean Implementation class (including template code), component and home interfaces
  • Adds a record to the standard deployment descriptor and server-specific deployment descriptor
  • The source editor with the bean implementation class appears, the individual Enterprise Bean node in the project explorer is selected

Step 2: New Message-Driven Bean - Name and Location

This wizard creates a new Message-Driven Bean - it creates the Bean Implementation class and adds records to deployment descriptors. It also creates a new Server Resource

Figure: Name and Location of

+---------------------------------------------------------------------------------+
| New Message-Driven Bean |
+---------------------------------------------------------------------------------+
| Name and Location |
| ------------------------------------------------------------------------------- |
| |
| EJB Name: |_MessageDrivenBean_________________________________________________| |
| |
| Project: |_Module6Ejb________________________________________________________| |
| Location: |_Source Packages__________________________________________________v| |
| Package: |_com.acme_________________________________________________________v| |
| |
| ------------------------------------------------------------------------------- |
| |
| Destination Type: |
| (o) Queue |
| ( ) Topic |
| |
| |
| |
| |
| |
+---------------------------------------------------------------------------------+
Components:
  • EJB Name text field - contains default value "NewMessage" - when changed, a default Display Name is generated
  • Display Name text field - according to Blueprint naming conventions, the naming is genereated from the EJB Name, however it can be changed by the user
  • Project, Location, Package - same behaviour as in New Java Class Wizard
  • Destination Type radio buttons - Queue selected by default

Inline errors:
  • EJB Name is required!
  • EJB Name has to be a valid Java identifier.
  • same Java error message -  "Warning: As of JDK1.4, it is highly recommended that you do NOT place Java classes in the default package"

Upon finishing the wizard:
  • Creates a Bean Implementation class (including template code)
  • Create a JMS Resouce (a Server Resource)
  • Adds a record to the standard deployment descriptor and server-specific deployment descriptor
  • The source editor with the bean implementation class appears, the individual Enterprise Bean node in the project explorer is selected

Step 2: New Entity Bean - Name and Location

This wizard allows the user to create a CMP Entity Bean or a BMP Entity Bean. It generates several files, fills the bean implementation class with some template code and adds records to deployment descriptors.

Figure: Name and Location of

+---------------------------------------------------------------------------------+
| New Entity Bean |
+---------------------------------------------------------------------------------+
| Name and Location |
| ------------------------------------------------------------------------------- |
| |
| EJB Name: |_EntityBean________________________________________________________| |
| |
| Project: |_Module6Ejb________________________________________________________| |
| Location: |_Source Packages__________________________________________________v| |
| Package: |_com.acme_________________________________________________________v| |
| |
| ------------------------------------------------------------------------------- |
| |
| Persistence Type: |
| (o) Container |
| ( ) Bean |
| |
| Create Interface: |
| [ ] Remote |
| [x] Local |
| |
| |
| |
+---------------------------------------------------------------------------------+
Components:
  • EJB Name text field - contains default value "NewEntity" - when changed, a default Display Name is generated
  • Display Name text field - according to Blueprint naming conventions, the naming is genereated from the EJB Name, however it can be changed by the user
  • Project, Location, Package - same behaviour as in New Java Class Wizard
  • Create Interface checkboxes - Local selected by default
  • Persistence Type radio buttons - Container selected by default

Inline errors:
  • EJB Name is required!
  • EJB Name has to be a valid Java identifier.
  • same Java error message -  "Warning: As of JDK1.4, it is highly recommended that you do NOT place Java classes in the default package"

Upon finishing the wizard:
  • Creates several Java files - Bean Implementation class (including template code), component and home interfaces
  • Adds a record to the standard deployment descriptor and server-specific deployment descriptor
  • If the user choosed Container managed persitance, a logical editor with the corresponding CMP Bean section selected is opened.
  • If the user choosed Bean manager persistance, the source editor with the bean implementation class appear.
  • In both cases, the individual Enterprise Bean node in the project explorer is selected.

Step 2: New CMP Entity Beans from Database - Database Source and Beans Location

This wizard creates several CMP Entity Beans at once according to existing database structure. It can retrieve the information from a JDBC connection or a dbschema, which is a file that contains the database metadata, and can be created by a tool being distributed along with Sun Application Server.

The wizard asks the user to provide source of database metadata information.

Figure: Database Source and Beans Location wizard panel

+----------------------------------------------------------------------------+
| New CMP Entity Beans from Database |
+----------------------------------------------------------------------------+
| Database Source and Beans Location |
| -------------------------------------------------------------------------- |
| |
| Select the database source to generate the CMP entity beans from. |
| |
| (o) JDBC Connection: |____________________________________v| |
| ( ) DB Schema File: |_____________________________________| [ Browse... ] |
| |
| |
| Specify the location for the generated CMP entity beans. |
| |
| Project: |_Module6Ejb___________________________________________________| |
| Location: |_Source Packages_____________________________________________v| |
| Package: |_com.acme____________________________________________________v| |
| |
| -------------------------------------------------------------------------- |
| |
| [ ] Generate finder methods for CMP fields |
| [ ] Add CMP and CMR fields to local interface |
| |
| |
| |
+----------------------------------------------------------------------------+
Components:
  • JDBC Connection radio button - selected by default
  • JDBC Connection combo box - enabled if JDBC Connection radio button is selected. Contains list of defined JDBC connections (Runtime/Server Navigator window). The last item is Add Connection... that open up a dialog for creating a new JDBC connection. Newly added connection appears selected in the combo after closing the dialog.
  • Database Schema File radio button
  • Database Schema File textfield - enabled if the Database Schema File radio button is selected. Contains the location and filename of the dbschema file.
  • Browse button - pops up a File Chooser titled Browse Database Schemawith *.dbschema - Database Schema File filter. The default browse location is the project folder.
  • Project, Location and Package - same behaviour as in previous wizards
  • Generate finder... check box - a finder method for each CMP field will be generated and added to component interfaces - i.e. findBy{$CMP field name} methods
  • Add CMP and CMR fields to local interface - promotes getters and setters to local interface (we might also promote CMP fields into remote interface)

Step 3: New CMP Entity Beans from Database - Database Tables

The user is supposed to select tables that will server as basic for new Entity Beans.

Figure: Name and Location of

+---------------------------------------------------------------------------------+
| New CMP Entity Beans from Database |
+---------------------------------------------------------------------------------+
| Database Tables |
| ------------------------------------------------------------------------------- |
| |
| Select the database tables that will be used as a source for CMP entity beans. |
| |
| Available Tables: Selected Tables: |
| +--------------------------+ +---------------------------+ |
| |CUSTOMER_TBL | | | |
| |MANUFACTURE_TBL | | | |
| |PRODUCT_TBL | | | |
| | | | | |
| | | [ Add > ] | | |
| | | [ < Remove ] | | |
| | | | | |
| | | [ Add All >> ] | | |
| | | [ << Remove All ] | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| |__________________________| |___________________________| |
| |
| Entity Beans will be generated for all referenced tables also. |
| |
+---------------------------------------------------------------------------------+
Behaviour:
  • This page should behave as in current implementation. 

Step 2: New Web Service - Name and Location

This wizard is used to create a new Web Service within an EJB Module or a Web Application. It creates a set of Java files (implementation file, interface, ...) and XML configuration files. It also adds some entries into deployment descriptor, if necesary.

It allows the user to encapsulate an Enterprise Bean or a POJO class - this means that necessary references and/or lookup methods will be created in the new WebService implementation class.

Figure: Name and Location of

+---------------------------------------------------------------------------------+
| New Web Service |
+---------------------------------------------------------------------------------+
| Name and Location |
| ------------------------------------------------------------------------------- |
| |
| Web Service Name: |_NewWebService_____________________________________________| |
| |
| Project: |_Module6Ejb________________________________________________________| |
| Location: |_Source Packages__________________________________________________v| |
| Package: |_com.acme_________________________________________________________v| |
| |
| ------------------------------------------------------------------------------- |
| |
| (o) Create an Empty WebService |
| |
| ( ) Encapsulate an Enterprise Bean |
| |
| Enterprise Bean: |{Project name#bean display-name}_________| [ Browse... ] |
| |
| ( ) Encapsulate a Java Class |
| |
| Java Class: |{Project name#Java Class}________________| [ Browse... ] |
| |
| |
| |
+---------------------------------------------------------------------------------+
Components:
  • Web Service Name text field - contains default value "NewWeb Service"
  • Create an Empty WebService radio button - an empty WS is created
  • Encapsulate an Enterprise Bean radio button - will create a reference and lookup method to an Enterprise Bean
  • Enterprise Bean disabled text field and Browse button (enabled if Encapsulate an Enterprise Bean radio button is selected)- same behaviour as ejb-link field of the EJB reference entry in the logical editor, the Browse button pops up a a chooser simmilar to Add EJB Reference dialog
  • Encapsulate a java Class radio button - will create a library dependency and an instance field of the chosen class
  • Java Class text field and Browse button (enabled if Encapsulate a Java Class is selected)

Step 2: New Web Service from WSDL - Name and Location

This wizard is used to create a new Web Service within an EJB Module or a Web Application using an existing WSDL file (bottom-up approach). The user is supposed to pick up a WSDL file, iterface and implementation class is populated with operations defined in the WSDL file then.

Figure: Name and Location of

+---------------------------------------------------------------------------------+
| New Web Service from WSDL |
+---------------------------------------------------------------------------------+
| Name and Location |
| ------------------------------------------------------------------------------- |
| |
| WSDL File: |_e:/worldWeather.wsdl_______________________| [ Browse... ] |
| Web Service Name: |_NewWebService______________________________| |
| |
| Project: | Module6Ejb | |
| Location: | Source Packages _________________________________________________v| |
| Package: | com.acme ________________________________________________________v| |
| |
| ------------------------------------------------------------------------------- |
| |
| |
| |
| |
+---------------------------------------------------------------------------------+
Components:
  • WSDL file text field and Browse button - allows the user to choose the source WSDL file
  • Web Service Name text field - default value determined from the Web Service Name of the WSDL file

Step 2: New Web Service Client - Name and Location

This wizard is used to create a Web Service client within a Web Application. The client consists of several xml files and Java classes that are genereted from a WSDL file. The WSDL file can be retrieved from a user specified URL or local file system. The WSDL file could be also provided by the Runtime registry (consuming registered Web Service). Another option is consuming a Web Service being created in another project - currently there is a need to deploy it on a server and download a WSDL file from it, however it might be possible to create a client for it without the need of deployment in the future.

Figure: Name and Location of

+---------------------------------------------------------------------------------+
| New Web Service Client |
+---------------------------------------------------------------------------------+
| Name and Location |
| ------------------------------------------------------------------------------- |
| |
| Specify the WSDL file of the Web Service. |
| |
| (o) Local File: |_e:\worldWeather.wsdl_______________________| [ Browse... ] |
| ( ) URL: |_serverHostname/WebServiceURI?wsdl__________| [ Set Proxy... ] |
| ( ) Registry: |_MyWebService______________________________v| |
| ( ) Project: |_ModuleEJB1#worldWeatherWS__________________| [ Browse... ] |
| |
| Specify a location for the client. |
| |
| Project: |_Module6Ejb________________________________________________________| |
| Location: |_Source Packages__________________________________________________v| |
| Package: | com.acme ________________________________________________________v| |
| |
| |
+---------------------------------------------------------------------------------+
Components:
  • From Local Filesystem radio button
  • WSDL File Location text field and Browse button (enabled if From Local Filesystem radio button is selected)
  • From an URL radio button
  • WSDL URL text field (enabled if From an URL radio button is selected) - default value suggests common format of these URLs
  • Set Proxy button (enabled if From an URL radio button is selected) - pops up a dialog allowing user to set the IDE wide HTTP proxy (provides an easy way to set it - i.e. the user does not have to go to options) - Note: we should inform the user that this is IDE wide setting, that can be set in Options dialog as well. It does not suggest that there might be dual setting!
  • From Web Services Registry radio button
  • Registered Web Service combobox, lists all WSs registred in Web Services Registry (or Server Navigator)
  • From Another NetBeans Project radio button, enables Web Service textfield and its Browse button
  • Web Service disabled textfield and Browse button - the behavior is very simmilar to ejb-link setting EJB reference section of the logical editor

Project Window

This variant shows only most important method (i.e. they are included in the client view and their code or definition is accessed very frequently). These are:

  • business methods and operations
  • finder methods
  • CMP Entity bean's ejbCreate (and ejbPostCreate) methods
  • Entity EJB's ejbHomeXXX methods

The reason why CMP bean's ejbCreate methods are included in this 'top' priority list is the fact, that they are necessary for each individual CMP bean. That's not true for other types of Enterprise Beans.

Figure: Individual EJB & WS Node Hierarchy

+----------------------------------------------+
| Projects |
+----------------------------------------------+
| - [A] MyAppEJB |
| - [E] Enterprise Beans |
| - [e] <name of entity bean> |
| - [C] CMP fields |
| - [f] accountId |
| - [l] owner |
| - [M] Local Methods |
| - [n] businessMethod |
| - [g] create |
| - [g] createFromDTO |
| - [i] findXXX |
| - [n] getFirstName |
| - [h] myHomeMethod |
| - [n] setFirstName |
| - [R] Remote Methods |
| - [n] businessMethod |
| - [g] create |
| - [i] findXXX |
| - [n] getFirstName |
| - [h] myHomeMethod |
| - [n] setFirstName |
| - [m] <name of message bean> |
| - [s] <name of session bean> |
| - [M] Local Methods |
| - [R] Remote Methods |
| - [W] Web Services |
| - [w] <name of webservice> |
| - [p] operation |
| + [C] Configuration Files |
| + [R] Server Resources |
| + [S] Source Packages |
| + [S] Test Packages |
| + [L] Libraries |
| + [L] Test Libraries |
| |
+----------------------------------------------+

Node: Individual Session Bean

  • Double clicking the node opens the source editor with the bean implementation class.
  • Read-only name: <bean-name>
  • Tooltip: Session Bean
  • Contextual menu:
    Open
    --------------
    Add >
    Delete
    --------------
    Refactor >
    --------------
    Go To Source >
  • Contextual menu - Add
    Add >
    Business Method...
  • Contextual menu - Go to Source
    Go To Source >
    Bean Implementation
    Remote Interface
    Local Interface
    Remote Home Interface
    Local Home Interface
  • Open - opens the source editor with bean implementation class
  • Delete - deletes the EJB and DD entries after getting confirmation from the user
  • Refactor - shows the refactoring contextual menu - Rename and Move Class will be the only things available
  • Add < Business Method - brings up the Add Business Method dialog; when finished, if the source editor is opened, the cursor is placed in the new method.
  • Go To Sources - Action items of this menu open source editor with a selected file. If a particular file is not present (i.g. a bean exposes only local interface), its action item is disabled.

Node: Individual BMP Entity Bean

  • Double clicking the node opens the source editor with the bean implementation class.
  • Read-only name: <bean-name>
  • Tooltip: BMP Entity Bean
  • Contextual menu:
    Open
    --------------
    Add >
    Delete
    --------------
    Refactor >
    --------------
    Go To Source >
  • Contextual menu - Add
    Add >
    Business Method...
    Create Method...
    Finder Method...
    Home Method...
  • Contextual menu - Go to Source
    Go To Source >
    Bean Implementation
    Remote Interface
    Local Interface
    Remote Home Interface
    Local Home Interface
    Primary Key Class
  • Open - opens the source editor with bean implementation class
  • Delete - deletes the EJB and DD entries after getting confirmation from the user
  • Refactor - shows the refactoring contextual menu - Rename and Move Class will be the only things available
  • Add < Business Method - brings up the Add Business Method dialog; when finished, if the source editor is opened, the cursor is placed in the new method.
  • Add > Create Method - TBD
  • Add > Finder Method - brings up the "Add Finder Method" dialog
  • Add > Home Method - TBD
  • Go To Sources - Action items of this menu open source editor with a selected file. If a particular file is not present (i.g. a bean exposes only local interface), its action item is disabled.

Node: Individual CMP Entity Bean

  • Double clicking the node opens the source editor with the bean implementation class.
  • Read-only name: <bean-name>
  • Tooltip: CMP Entity Bean
  • Contextual menu:
    Open
    --------------
    Add >
    Delete
    --------------
    Refactor >
    --------------
    Go To Source >
  • Contextual menu - Add
    Add >
    Business Method...
    Create Method...
    Finder Method...
    Home Method...
    Select Method...
    CMP Field...
  • Contextual menu - Go to Source
    Go To Source >
    Bean Implementation
    Remote Interface
    Local Interface
    Remote Home Interface
    Local Home Interface
    Primary Key Class
  • Open - opens the source editor with bean implementation class
  • Delete - deletes the EJB and DD entries after getting confirmation from the user
  • Refactor - shows the refactoring contextual menu - Rename and Move Class will be the only things available
  • Add < Business Method - brings up the Add Business Method dialog; when finished, if the source editor is opened, the cursor is placed in the new method.
  • Add > Create Method - TBD
  • Add > Finder Method - brings up the "Add Finder Method" dialog
  • Add > Home Method - TBD
  • Add > Select Method - present only in CMP Bean context menu; brings up the "Add Select Method" dialog
  • Add > CMP Field - present only in CMP Bean context menu; brings up the "Add CMP Field" dialog
  • Go To Sources - Action items of this menu open source editor with a selected file. If a particular file is not present (i.g. a bean exposes only local interface), its action item is disabled.

Node: Individual Message Driven Bean

  • Double clicking the node opens the source editor with the bean implementation class.
  • Read-only name: <bean-name>
  • Tooltip: Message Driven Bean
  • Contextual menu:
    Open
    ------
    Delete
  • Open - opens the source editor with bean implementation class
  • Delete - deletes the EJB and DD entries after getting confirmation from the user

Node: CMP Fields

Double-clicking on this item opens the logical editor with CMP Fields section selected (focused). The context menu contains only one item - "Add CMP Field" - the behaviour is the same as of this item's counterpart of the individual bean's context menu.

Node: Individual CMP Field

Double-clicking on this item opens the Edit CMP Field dialog.

Contextual Menu

Edit ...
Delete    Delete
The delete action pops up a confirmation dialog: "Are you sure you want to delete this CMP Field? [ Yes ] / [ No ]".

Node: Local Methods, Remote Methods


This node is expanded when double-clicked.

Contextual Menu

Add  >
Business Method ...
Create Method ...
Home Method ...
Find Method ...
Select Method ...
Delete ...
Note: Select Method is present only on Local Methods node

The Add >  actions (and menu - items presence) have the same behaviour as their conter parts of the individual bean's context menu with the exception that the default value of "Add To Interface" checkboxes is not set according to previous settings but according to selected container (i.e. Add To Local Inteface is checked when activated from Local Methods container and vice versa).

The Delete > action pops up a confirmation dialog "Are you sure you want to delete {Local | Remote} Interface? [ Yes ] / [ No ]". If confirmed, the local interface is removed (i.e. the class file is deleted and deployment descriptors are removed).


Node: Invididual Business Method, Create Method, Home Method

Double-clicking the node opens the source editor with the cursor placed in the method's body.

Contextual Menu

Go To Source
Delete Delete
Find Usages
Show Javadoc
Refactor >
Tools
------------
Properties

Behaviour:
  • Go To Source action opens the source editor with the cursor placed in the method's body.
  • Delete action - removes the method from interface.
  • Refactor > submenu contains same items as the one, activated from the source editor. - Note: this is not currenlty implemented for standard Java structure.
  • Find Usages and Show javadoc action items invoke same actions as those from the Java source editor context menu.
  • Tools and Properties actions - same behaviour as on the Java method node of the Java structure subtree.

Node: Invididual Find Method


Contextual Menu

Edit ..
Delete Delete
Find Usages
Show Javadoc
Refactor >
Tools
------------
Properties
Behaviour:

Node: Individual WS Operation


The context menu and overall behaviour is the same as the one of a business method node.

Source Editor

The Java source editor has some extended features in following cases:
  • editing an Enterprise Bean implementation class within EJB Module project,
  • editing any class within Web Application project.

Source Editor: Bean Implementation Class


Contextual Menu


This contextual menu can be activated from any position of the Java source code.
Go To                >
Enterprise Bean >
Enterprise Resources >
...
standard Java source context menu items continue here

Contextual Menu: Enterprise Bean


This contextual menu relates to the edited bean, it contains actions used to modify the description and implementation of the bean.

Enterprise Bean >
Add To Local Interface
Add To Remote Interface
Add Business Method ...
Add CMP Field ...
Add Create Method ...
Add Home Method ...
Add Find Method ...
Add Select Method ...
CMP Relationship ...

Description:
  • Add To Local Interface, Add To Remote Interface actions - present only if the context menu was activated on a method and the bean has that interface (here component interface is meant for general public methods, home interface is meant for methods with name starting on "ejb" - excluding those methods, that can not be in any interface - i.e. ejbActivate, setSessionContext, etc.). These actions add the concrete method to a particular interface.
  • Add ... actions - these actions have same behaviour (including appearance) as their counterparts of the individual bean node's context menu
    

Contextual Menu: Enterprise Resources


This contextual menu relates to the edited bean, however it contains actions used to modify and interact with the bean enviroment.

Enterprise Resources >
Call Enterprise Bean ...
Use Database ...
Send JMS Message ...

These actions are described in following subchapters.

Source Editor: Call Enterprise Bean


This action creates:
  • an EJB reference in the deployment descriptor (i.e. a JNDI entry in the local bean's environment)
  • a lookup method in the source code  - the lookup method returns a reference to home (Statefull Session Bean and Entity Bean) or component (Stateless Session Bean) interface
When the action is activated, the Call Enterprise Bean dialog appears:

|----------------------------------------------------------|
| Call Enterprise Bean |
|----------------------------------------------------------|
| |
| Choose Enterprise JavaBean: |
| |
| |------------------------------------------------------| |
| |[-] Module1Ejb |^| |
| | [-] MySessionSB | | |
| | [-] CustomerEB | | |
| |[+] Module2Ejb | | |
| | |v| |
| |------------------------------------------------------| |
| |
| Reference name: |MySession | |
| |
| Referenced Interface: (o) Local (o) Remote |
| |
| Lookup method name: |lookupMySessionLocal() |
| |
| |
| [ OK ] [ Cancel ] |
| |
|----------------------------------------------------------|
The behaviour of this dialog is similar to Add EJB Reference dialog, with the addition of:
  • Lookup method name editable textfield - it's value is generated from EJB name and selected interface, it can be edited by the user. The name is validated in the sense that there can not be two methods with same signature - the error message is then "Lookup method allready exists!"

Source Editor: Use Database


This action creates:
  • a resource reference entry in the deployment descriptor
  • a lookup method in the source code
  • a server resource in the project
When the action is actived, the Choose Database dialog pops up:



  • JNDI name text field allows the user to enter a JNDI name for the resource reference entry
  • Connection combobox contains a list of connections defined in the Runtime tab (Server Navigator)
  • Add Driver and Add Connection buttons have same functionality as context menu actions of the Runtime tab (Server Navigator)

Source Editor: Send JMS Message


This action creates:
  • a resource reference entry in the deployment descriptor
  • (a server resource - note: need to check this)
  • message destination reference in the deployment descriptor
  • lookup&send method (i.e. sendJMSMessageTo{message-destionation-name})
  • a template createJMSMesasageFor{message-destination-name} method
When the action is invoked, the Send JMS Message dialog appears:
|----------------------------------------------------------|
| Send JMS Message |
|----------------------------------------------------------|
| |
| Choose Message Destination: |
| |
| |------------------------------------------------------| |
| |[-] Module1Ejb |^| |
| | [-] NewMessageDestination | | |
| |[+] Module2Ejb | | |
| | |v| |
| |------------------------------------------------------| |
| |
| Reference name: |MySession | |
| |
| Referenced Interface: (o) Local (o) Remote |
| |
| Lookup method name: |lookupMySessionLocal() |
| |
| |
| [ OK ] [ Cancel ] |
| |
|----------------------------------------------------------|

Note: this needs to be precised (and will be very soon)


Source Editor: A class within a Web Application


Contextual Menu


This contextual menu can be activated from any position of the Java source code.
Go To                      >
Enterprise Resources >
Call Web Service Operation
...
standard Java source context menu items continue here
The Enterprise Resources submenu has the same behaviour as in Bean Implementation Class.

The Call Web Service Operation action invokes "Select Operation to Invoke" dialog:



The "Available Web Services" list contains all Web Service clients defined in the Web Application including their ports and operations as child nodes. Confirming this dialog will:
  • add two instance member fields to the current class - a reference to the WS deleagate and to a WS port
  • add getter method for WS delegate (lazy instantiating)
  • add getter method for WS port (using WS delegate getter)
  • add following code at the current cursor position:
	try {
            return getPort().operation(/* TODO enter operation arguments */);
        } catch(java.rmi.RemoteException ex) {
            return 0;
        }


Web Services Registry

Web Services Registry is a tree of the Runtime tab. It is a place which lists the web services that a project within the IDE can consume and enables users to explore the APIs of the web service.  Users can add more known web services to it by specifying a WSDL. By default, it should list some sample web services that the user can play with, such as the TemperatureService on XMethods.com.

Web Services Registry nodes

| -- [W] Web Services                   |
| -- [G] Samples |
| | -- [w] TemperatureService |
| | | -- [P] publicPort |
| | | | -- [o] getTemperature |
| | | -- [P] securedPort |
| | +- [w] StocksService |
| +- [w] UserService |
Note: The icons are specified in the EJB Module Project UI spec.

The web services can be optionally grouped into web services groups.





Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems