Java Reference
In-Depth Information
java.rmi.RemoteException;
String getBoardName()throws java.rmi.RemoteException;
String getName() throws java.rmi.RemoteException;
Post getPost(int postID) throws java.rmi.RemoteException;
Collection getPosts() throws java.rmi.RemoteException;
int getDiscussionID() throws java.rmi.RemoteException;
void removePost(Post post)
throws java.rmi.RemoteException, javax.ejb.RemoveException;
void setName(java.lang.String newValue)
throws java.rmi.RemoteException;
}
The remote interface for Post
The Post interface is a little simpler. Because its members are all primitive
objects and not collections, they consist of only getter and setter methods.
Later, this will make the implementation class much simpler. If we view our
object model as a tree, then a post is a leaf node:
package com.bitterjava.bbs.ejb;
public interface Post extends javax.ejb.EJBObject {
java.lang.String getAuthor() throws java.rmi.RemoteException;
java.sql.Date getDate() throws java.rmi.RemoteException;
int getPostID() throws java.rmi.RemoteException;
String getSubject() throws java.rmi.RemoteException;
String getText() throws java.rmi.RemoteException;
void setAuthor(java.lang.String newValue) throws
java.rmi.RemoteException;
void setDate(java.sql.Date newValue) throws java.rmi.RemoteException;
void setSubject(String newValue)
throws java.rmi.RemoteException;
void setText(java.lang.String newValue)
throws java.rmi.RemoteException;
}
Together, these three interfaces make up the business types in our domain.
We'll also need an interface to add and remove these items from a container,
and finder methods to locate groups of these objects, because these methods
do not logically belong on a single object.
Search WWH ::




Custom Search