The Component Interface; The Enterprise Bean Class - Red Hat APPLICATION SERVER - JONAS Manual

Jonas
Hide thumbs Also See for APPLICATION SERVER - JONAS:
Table of Contents

Advertisement

74
All the exceptions defined in the
clause of the matching
throws
A remote home interface extends the
extends the
javax.ejb.EJBLocalHome
7.2.1. Session Bean Example:
The following examples use a Session Bean named
public interface OpHome extends EJBHome {
Op create(String user) throws CreateException, RemoteException;
}
A local home interface could be defined as follows (
the bean):
public interface LocalOpHome extends EJBLocalHome {
LocalOp create(String user) throws CreateException;
}

7.3. The Component Interface

The Component Interface is the client's view of an instance of the Session Bean. This interface
contains the business methods of the Enterprise Bean. If it is remote, the interface must
extend the
javax.ejb.EJBObject
javax.ejb.EJBLocalObject
must follow the rules for Java RMI (this means that their arguments and return value must be valid
types for Java RMI, and their throws clause must include the
each method defined in the component interface, there must be a matching method in the enterprise
Bean's class (same name, same arguments number and types, same return type, and same exception
list, except for
RemoteException
7.3.1. Example:
public interface Op extends EJBObject {
public void buy (int Shares)
public int
}
The same type of component interface could be defined as a local interface (even if it is not considered
good design to define the same interface as both local and remote):
public interface LocalOp extends EJBLocalObject {
public void buy (int Shares);
public int
}
throws
method of the home interface.
create
javax.ejb.EJBHome
interface.
interface; if it is local, the interface must extend the
interface. The methods defined in a remote component interface
).
read ()
read ();
Chapter 7. Developing Session Beans
clause of an
ejbCreate
interface, while a local home interface
.
Op
being the local component interface of
LocalOp
java.rmi.RemoteException
throws RemoteException;
throws RemoteException;
method must be defined in the
). For

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the APPLICATION SERVER - JONAS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Application server

Table of Contents