User: jwalters
  Date: 01/06/04 08:57:17

  Modified:    src/main/javax/ejb EJBContext.java EJBException.java
                        EJBLocalHome.java EJBLocalObject.java
                        EntityContext.java MessageDrivenBean.java
                        NoSuchEntityException.java
                        ObjectNotFoundException.java RemoveException.java
                        SessionContext.java
  Added:       src/main/javax/ejb AccessLocalException.java
                        NoSuchObjectLocalException.java
                        TransactionRequiredLocalException.java
                        TransactionRolledbackLocalException.java
  Log:
  Complete set of changes for EJB 2.0 PFD 2.0.
  Thanks to Jasper Pedersen - [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.2       +6 -1      jboss-j2ee/src/main/javax/ejb/EJBContext.java
  
  Index: EJBContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-j2ee/src/main/javax/ejb/EJBContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EJBContext.java   2001/03/30 11:37:51     1.1
  +++ EJBContext.java   2001/06/04 15:57:17     1.2
  @@ -32,7 +32,12 @@
     /**
      * Obtains the enterprise bean's home interface.
      */
  -  public abstract EJBHome getEJBHome();
  +  public abstract EJBHome getEJBHome() throws IllegalStateException;
  +
  +  /**
  +   * Obtain the enterprise bean's local home interface.
  +   */
  +  public abstract EJBLocalHome getEJBLocalHome() throws IllegalStateException;
   
     /**
      * <B>Deprecated.</B> Obtains the enterprise bean's environment properties.
  
  
  
  1.2       +53 -1     jboss-j2ee/src/main/javax/ejb/EJBException.java
  
  Index: EJBException.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-j2ee/src/main/javax/ejb/EJBException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EJBException.java 2001/03/30 11:37:51     1.1
  +++ EJBException.java 2001/06/04 15:57:17     1.2
  @@ -26,7 +26,6 @@
      */
     public EJBException(Exception ex) {
       super();
  -    causeException = null;
       causeException = ex;
     }
   
  @@ -39,9 +38,62 @@
     }
   
     /**
  +   * Constructs an EJBException with the specified message and the
  +   * originally throw exception.
  +   */
  +  public EJBException(String message, Exception ex) {
  +      super(message);
  +      causeException = ex;
  +  }
  +
  +  /**
      * Obtain the exception that caused the EJBException being thrown.
      */
     public Exception getCausedByException() {
       return causeException;
  +  }
  +
  +  /**
  +   * Obtain the detailed message for this exception and the embedded
  +   * exception if there is one.
  +   */
  +  public String getMessage() {
  +      StringBuffer s = new StringBuffer();
  +      s.append( super.getMessage() );
  +      if( causeException != null ) {
  +          s.append( "\nEmbedded Exception\n" );
  +       s.append( causeException.getMessage() );
  +      }
  +      return s.toString();
  +  }
  +
  +  /**
  +   * Print composite stack trace to System.err
  +   */
  +  public void printStackTrace() {
  +      super.printStackTrace();
  +      if( causeException != null ) {
  +          causeException.printStackTrace();
  +      }
  +  }
  +
  +  /**
  +   * Print composite stack trace to PrintStream ps
  +   */
  +  public void printStackTrace( java.io.PrintStream ps ) {
  +      super.printStackTrace(ps);
  +      if( causeException != null ) {
  +          causeException.printStackTrace(ps);
  +      }
  +  }
  +
  +  /**
  +   * Print composite stack trace to PrintWriter pw
  +   */
  +  public void printStackTrace( java.io.PrintWriter pw ) {
  +      super.printStackTrace(pw);
  +      if( causeException != null ) {
  +          causeException.printStackTrace(pw);
  +      }
     }
   }
  
  
  
  1.2       +24 -5     jboss-j2ee/src/main/javax/ejb/EJBLocalHome.java
  
  Index: EJBLocalHome.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-j2ee/src/main/javax/ejb/EJBLocalHome.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EJBLocalHome.java 2001/06/02 20:54:55     1.1
  +++ EJBLocalHome.java 2001/06/04 15:57:17     1.2
  @@ -4,12 +4,31 @@
    * Distributable under LGPL license.
    * See terms of license at gnu.org.
    */
  -
   package javax.ejb;
   
  -public interface EJBLocalHome
  -{
  +/**
  + * <p>The EJBLocalHome interface must be extended by all enterprise Beans'
  + * local home interfaces. An enterprise Bean's local home interface defines
  + * the methods that allow local clients to create, find, and remove EJB
  + * objects, as well as home business methods that are not specific to a
  + * bean instance (session Beans do not have finders and home business methods).</p>
  + *
  + * <p>The local home interface is defined by the enterprise Bean provider
  + * and implemented by the enterprise Bean container.</p>
  + */
  +public abstract interface EJBLocalHome {
   
  -    public abstract void remove(Object obj)
  -        throws RemoveException, EJBException;
  +  /**
  +   * <p>Remove an EJB object identified by its primary key.</p>
  +   *
  +   * <p>This method can only be used by local clients of an entity bean.
  +   * An attempt to call this method on a session bean will result in an 
EJBException.</p>
  +   *
  +   * @param primaryKey - The primary key
  +   * @exception RemoveException - Thrown if the enterprise Bean or the container 
does
  +   *                              not allow the client to remove the object.
  +   * @exception EJBException - Thrown when the method failed due to a system-level 
failure.
  +   */
  +  public abstract void remove(java.lang.Object primaryKey)
  +    throws RemoveException, EJBException;
   }
  
  
  
  1.2       +50 -8     jboss-j2ee/src/main/javax/ejb/EJBLocalObject.java
  
  Index: EJBLocalObject.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-j2ee/src/main/javax/ejb/EJBLocalObject.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EJBLocalObject.java       2001/06/02 20:54:55     1.1
  +++ EJBLocalObject.java       2001/06/04 15:57:17     1.2
  @@ -6,15 +6,57 @@
    */
   package javax.ejb;
   
  -public interface EJBLocalObject
  -{
  +/**
  + * <p>The EJBLocalObject interface must be extended by all enterprise
  + * Beans' local interfaces. An enterprise Bean's local interface provides
  + * the local client view of an EJB object. An enterprise Bean's local interface
  + * defines the business methods callable by local clients.</p>
  + *
  + * <p>The enterprise Bean's local interface is defined by the enterprise Bean
  + * provider and implemented by the enterprise Bean container.</p>
  + */
  +public abstract interface EJBLocalObject {
   
  -  public EJBLocalHome getEJBLocalHome();
  -  
  -  public Object getPrimaryKey();
  +  /**
  +   * Obtain the enterprise Bean's local home interface. The local home interface
  +   * defines the enterprise Bean's create, finder, remove, and home business methods
  +   * that are available to local clients.
  +   *
  +   * @return A reference to the enterprise Bean's local home interface.
  +   * @exception EJBException - Thrown when the method failed due to a system-level 
failure.
  +   */
  +  public abstract EJBLocalHome getEJBLocalHome()
  +    throws EJBException;
   
  -  public boolean isIdentical(EJBLocalObject local);
  +  /**
  +   * <p>Obtain the primary key of the EJB local object.</p>
  +   *
  +   * <p>This method can be called on an entity bean. An attempt to invoke this 
method
  +   * on a session Bean will result in an EJBException.</p>
  +   *
  +   * @return The EJB local object's primary key.
  +   * @exception EJBException - Thrown when the method failed due to a system-level 
failure.
  +   */
  +  public abstract java.lang.Object getPrimaryKey()
  +    throws EJBException;
   
  -  public void remove()
  -        throws RemoveException;
  +  /**
  +   * Remove the EJB local object.
  +   *
  +   * @exception RemoveException - The enterprise Bean or the container does not 
allow
  +   *                              destruction of the object.
  +   * @exception EJBException - Thrown when the method failed due to a system-level 
failure.
  +   */
  +  public abstract void remove()
  +    throws RemoveException, EJBException;
  +
  +  /**
  +   * Test if a given EJB local object is identical to the invoked EJB local object.
  +   *
  +   * @param obj - An object to test for identity with the invoked object.
  +   * @return True if the given EJB local object is identical to the invoked object, 
false otherwise.
  +   * @exception EJBException - Thrown when the method failed due to a system-level 
failure.
  +   */
  +  public abstract boolean isIdentical(EJBLocalObject obj)
  +    throws EJBException;
   }
  
  
  
  1.2       +6 -0      jboss-j2ee/src/main/javax/ejb/EntityContext.java
  
  Index: EntityContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-j2ee/src/main/javax/ejb/EntityContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EntityContext.java        2001/03/30 11:37:51     1.1
  +++ EntityContext.java        2001/06/04 15:57:17     1.2
  @@ -21,6 +21,12 @@
   public interface EntityContext extends EJBContext {
   
     /**
  +   * Obtains a reference to the EJB local object that is currently associated
  +   * with the instance.
  +   */
  +  public abstract EJBLocalObject getEJBLocalObject() throws IllegalStateException;
  +
  +  /**
      * Obtains a reference to the EJB object that is currently associated
      * with the instance.
      */
  
  
  
  1.2       +2 -3      jboss-j2ee/src/main/javax/ejb/MessageDrivenBean.java
  
  Index: MessageDrivenBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-j2ee/src/main/javax/ejb/MessageDrivenBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MessageDrivenBean.java    2001/03/30 11:37:51     1.1
  +++ MessageDrivenBean.java    2001/06/04 15:57:17     1.2
  @@ -14,17 +14,16 @@
    * enterprise bean class.  The container uses the MessageDrivenBean methods
    * to notify the enterprise bean instances of the instance's life cycle events.
    */
  -
   public interface MessageDrivenBean extends EnterpriseBean {
   
       /**
        * The container invokes this method before it removes the EJBObject
        * that is currently associated with this instance.
        */
  -    void ejbRemove() throws RemoteException;
  +    public abstract void ejbRemove() throws RemoteException;
   
       /**
        * Sets the associated message driven context.
        */
  -    void setMessageDrivenContext( MessageDrivenContext ctx ) throws RemoteException;
  +    public abstract void setMessageDrivenContext( MessageDrivenContext ctx ) throws 
RemoteException;
   }
  
  
  
  1.2       +22 -1     jboss-j2ee/src/main/javax/ejb/NoSuchEntityException.java
  
  Index: NoSuchEntityException.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-j2ee/src/main/javax/ejb/NoSuchEntityException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NoSuchEntityException.java        2001/03/30 11:37:51     1.1
  +++ NoSuchEntityException.java        2001/06/04 15:57:17     1.2
  @@ -6,14 +6,35 @@
    */
   package javax.ejb;
   
  -
  +/**
  + * <p>The NoSuchEntityException exception is thrown by an Entity Bean
  + * instance to its container to report that the invoked business method
  + * or callback method could not be completed because of the underlying
  + * entity was removed from the database.</p>
  + *
  + * <p>This exception may be thrown by the bean class methods that implement
  + * the business methods defined in the bean's component interface; and by the
  + * ejbLoad and ejbStore methods.</p>
  + */
   public class NoSuchEntityException extends EJBException {
  +
  +  /**
  +   * Constructs a NoSuchEntityException with no detail message.
  +   */
     public NoSuchEntityException() {
       super();
     }
  +
  +  /**
  +   * Constructs a NoSuchEntityException that embeds the originally thrown exception.
  +   */
     public NoSuchEntityException(Exception ex) {
       super(ex);
     }
  +
  +  /**
  +   * Constructs a NoSuchEntityException with the specified detailed message.
  +   */
     public NoSuchEntityException(String message) {
       super(message);
     }
  
  
  
  1.2       +17 -1     jboss-j2ee/src/main/javax/ejb/ObjectNotFoundException.java
  
  Index: ObjectNotFoundException.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-j2ee/src/main/javax/ejb/ObjectNotFoundException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ObjectNotFoundException.java      2001/03/30 11:37:51     1.1
  +++ ObjectNotFoundException.java      2001/06/04 15:57:17     1.2
  @@ -6,11 +6,27 @@
    */
   package javax.ejb;
   
  -
  +/**
  + * <p>The ObjectNotFoundException exception is thrown by a finder method
  + * to indicate that the specified EJB object does not exist.</p>
  + *
  + * <p>Only the finder methods that are declared to return a single EJB object
  + * use this exception. This exception should not be thrown by finder methods
  + * that return a collection of EJB objects (they should return an empty collection
  + * instead).</p>
  + */
   public class ObjectNotFoundException extends FinderException {
  +
  +  /**
  +   * Constructs an ObjectNotFoundException with no detail message.
  +   */
     public ObjectNotFoundException() {
       super();
     }
  +
  +  /**
  +   * Constructs an ObjectNotFoundException with the specified detail message.
  +   */
     public ObjectNotFoundException(String message) {
       super(message);
     }
  
  
  
  1.2       +13 -1     jboss-j2ee/src/main/javax/ejb/RemoveException.java
  
  Index: RemoveException.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-j2ee/src/main/javax/ejb/RemoveException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RemoveException.java      2001/03/30 11:37:51     1.1
  +++ RemoveException.java      2001/06/04 15:57:17     1.2
  @@ -6,11 +6,23 @@
    */
   package javax.ejb;
   
  -
  +/**
  + * The RemoveException exception is thrown at an attempt to remove an EJB
  + * object when the enterprise Bean or the container does not allow the EJB
  + * object to be removed.
  + */
   public class RemoveException extends Exception {
  +
  +  /**
  +   * Constructs an RemoveException with no detail message.
  +   */
     public RemoveException() {
       super();
     }
  +
  +  /**
  +   * Constructs an RemoveException with the specified detail message.
  +   */
     public RemoveException(String message) {
       super(message);
     }
  
  
  
  1.2       +6 -0      jboss-j2ee/src/main/javax/ejb/SessionContext.java
  
  Index: SessionContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-j2ee/src/main/javax/ejb/SessionContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SessionContext.java       2001/03/30 11:37:51     1.1
  +++ SessionContext.java       2001/06/04 15:57:17     1.2
  @@ -16,6 +16,12 @@
   public interface SessionContext extends EJBContext {
   
     /**
  +   * Obtains a reference to the EJB local object that is currently associated
  +   * with the instance.
  +   */
  +  public abstract EJBLocalObject getEJBLocalObject() throws IllegalStateException;
  +
  +  /**
      * Obtains a reference to the EJB object that is currently associated
      * with the instance.
      */
  
  
  
  1.1                  jboss-j2ee/src/main/javax/ejb/AccessLocalException.java
  
  Index: AccessLocalException.java
  ===================================================================
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package javax.ejb;
  
  /**
   * An AccessLocalException is thrown to indicate that the caller does not
   * have permission to call the method. This exception is thrown to local clients.
   */
  public class AccessLocalException extends EJBException {
  
    /**
     * Constructs an AccessLocalException with no detail message.
     */
    public AccessLocalException() {
      super();
    }
  
    /**
     * Constructs an AccessLocalException with the specified detail message.
     */
    public AccessLocalException(java.lang.String message) {
      super(message);
    }
  
    /**
     * Constructs an AccessLocalException with the specified detail message and a 
nested exception.
     */
    public AccessLocalException(java.lang.String message,
                                java.lang.Exception ex) {
      super(message,ex);
    }
  }
  
  
  
  1.1                  jboss-j2ee/src/main/javax/ejb/NoSuchObjectLocalException.java
  
  Index: NoSuchObjectLocalException.java
  ===================================================================
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package javax.ejb;
  
  /**
   * A NoSuchObjectLocalException is thrown if an attempt is made to invoke
   * a method on an object that no longer exists.
   */
  public class NoSuchObjectLocalException extends EJBException {
  
    /**
     * Constructs a NoSuchObjectLocalException with no detail message.
     */
    public NoSuchObjectLocalException() {
      super();
    }
  
    /**
     * Constructs a NoSuchObjectLocalException with the specified detailed message.
     */
    public NoSuchObjectLocalException(String message) {
      super(message);
    }
  
    /**
     * Constructs a NoSuchObjectLocalException with the specified detail message and a
     * nested exception.
     */
    public NoSuchObjectLocalException(String message, Exception ex) {
      super(message,ex);
    }
  }
  
  
  
  1.1                  
jboss-j2ee/src/main/javax/ejb/TransactionRequiredLocalException.java
  
  Index: TransactionRequiredLocalException.java
  ===================================================================
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package javax.ejb;
  
  /**
   * This exception indicates that a request carried a null transaction context,
   * but the target object requires an activate transaction.
   */
  public class TransactionRequiredLocalException extends EJBException {
  
    /**
     * Constructs a TransactionRequiredLocalException with no detail message.
     */
    public TransactionRequiredLocalException() {
      super();
    }
  
    /**
     * Constructs a TransactionRequiredLocalException with the specified detailed 
message.
     */
    public TransactionRequiredLocalException(String message) {
      super(message);
    }
  }
  
  
  
  1.1                  
jboss-j2ee/src/main/javax/ejb/TransactionRolledbackLocalException.java
  
  Index: TransactionRolledbackLocalException.java
  ===================================================================
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package javax.ejb;
  
  /**
   * This exception indicates that the transaction associated with processing
   * of the request has been rolled back, or marked to roll back. Thus the
   * requested operation either could not be performed or was not performed
   * because further computation on behalf of the transaction would be fruitless.
   */
  public class TransactionRolledbackLocalException extends EJBException {
  
    /**
     * Constructs a TransactionRolledbackLocalException with no detail message.
     */
    public TransactionRolledbackLocalException() {
      super();
    }
  
    /**
     * Constructs a TransactionRolledbackLocalException with the specified detailed 
message.
     */
    public TransactionRolledbackLocalException(String message) {
      super(message);
    }
  
    /**
     * Constructs a TransactionRolledbackLocalException with the specified detail
     * message and a nested exception.
     */
    public TransactionRolledbackLocalException(String message,Exception ex) {
      super(message,ex);
    }
  }
  
  
  

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

Reply via email to