User: vharcq  
  Date: 01/06/20 15:01:14

  Added:       src/examples/org/jboss/docs/cmp/cd/interfaces CD.java
                        CDCollection.java CDCollectionHome.java
                        CDExistsException.java CDHome.java
  Log:
  Docs chapter 4 CD examples
  
  Revision  Changes    Path
  1.1                  manual/src/examples/org/jboss/docs/cmp/cd/interfaces/CD.java
  
  Index: CD.java
  ===================================================================
  package org.jboss.docs.cmp.cd.interfaces;
  
  import javax.ejb.EJBObject;
  import java.rmi.RemoteException;
  
  /**
   * This interface defines the remote interface for the CD Bean
   */
  public interface CD
  extends EJBObject
  {
     public Integer getId() throws RemoteException;
  
     public void setId(Integer id) throws RemoteException;
  
     public String getTitle() throws RemoteException;
  
     public void setTitle(String title) throws RemoteException;
  
     public String getArtist() throws RemoteException;
  
     public void setArtist(String artist) throws RemoteException;
  
     public String getType() throws RemoteException;
  
     public void setType(String type) throws RemoteException;
  
     public String getNotes() throws RemoteException;
  
     public void setNotes(String type) throws RemoteException;
  
  }
  
  
  1.1                  
manual/src/examples/org/jboss/docs/cmp/cd/interfaces/CDCollection.java
  
  Index: CDCollection.java
  ===================================================================
  package org.jboss.docs.cmp.cd.interfaces;
  
  import javax.ejb.EJBObject;
  import javax.ejb.FinderException;
  import java.rmi.RemoteException;
  
  /**
   * This interface defines the remote interface for the `CDCollection' EJB.
   */
  
  public interface CDCollection
  extends EJBObject
  {
  
     /**
      * Adds a CD to the collection, if possible
      */
     public void addCd(String id, String title, String artist, String type,
        String notes)
        throws RemoteException, CDExistsException;
  
     /**
      * Deletes all CDs from the database
      */
     public void deleteAll()
     throws RemoteException;
  
     public CD[] findAll()
     throws RemoteException, FinderException;
  
     public CD[] lookupInAnyField(String s)
     throws RemoteException, FinderException;
  
  }
  
  
  
  
  1.1                  
manual/src/examples/org/jboss/docs/cmp/cd/interfaces/CDCollectionHome.java
  
  Index: CDCollectionHome.java
  ===================================================================
  package org.jboss.docs.cmp.cd.interfaces;
  
  import javax.ejb.CreateException;
  import javax.ejb.EJBHome;
  import java.rmi.RemoteException;
  
  /**
   * This interface defines the home interface for the `CDCollection' EJB.
   */
  
  public interface CDCollectionHome
  extends EJBHome
  {
  
     /**
      * Creates an instance of the `CDCollectionBean' class on the server, and
      * returns a remote reference to a CDCollection interface on the client.
      */
     CDCollection create() throws RemoteException, CreateException;
  
  }
  
  
  
  1.1                  
manual/src/examples/org/jboss/docs/cmp/cd/interfaces/CDExistsException.java
  
  Index: CDExistsException.java
  ===================================================================
  package org.jboss.docs.cmp.cd.interfaces;
  
  /**
   * This exception is thrown if the client tries to add a CD to the collection
   * whose ID already exists in the database
   */
  public class CDExistsException extends Exception
  {
  
     private String text;
  
     public CDExistsException(String _text)
     {
        text = _text;
     }
  
     public CDExistsException()
     {
        text = "A CD with this ID already exists";
     }
  
     public String toString()
     {
        return text;
     }
  
  }
  
  
  
  
  1.1                  manual/src/examples/org/jboss/docs/cmp/cd/interfaces/CDHome.java
  
  Index: CDHome.java
  ===================================================================
  package org.jboss.docs.cmp.cd.interfaces;
  
  import javax.ejb.EJBHome;
  import javax.ejb.CreateException;
  import javax.ejb.FinderException;
  import java.rmi.RemoteException;
  import java.util.Collection;
  
  /**
   * This interface defines the home interface for the CD Bean
   */
  public interface CDHome
  extends EJBHome
  {
  
     /**
      * Create a new CD instance
      */
     public CD create(Integer id)
     throws RemoteException, CreateException;
  
     /**
      * Find the CD with the specified ID. This method is implemented by the
      * container
      */
     public CD findByPrimaryKey (Integer id)
     throws RemoteException, FinderException;
  
     /**
      * Finds the CD whose "type" attribute matches that specified.
      * This method is implemented by the container
      */
     public Collection findByType (String type)
     throws RemoteException, FinderException;
  
     /**
      * Get all CD instances. This method is implemented by the container
      */
     public Collection findAll()
     throws RemoteException, FinderException;
  
  }
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to