KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > entityexc > interfaces > EntityExc


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.entityexc.interfaces;
23
24 import java.rmi.RemoteException JavaDoc;
25 import javax.ejb.EJBObject JavaDoc;
26
27
28 /**
29  * Remote interface of entity exception test bean.
30  *
31  * @author <a HREF="mailto:osh@sparre.dk">Ole Husgaard</a>
32  * @version $Revision: 37406 $
33  */

34 public interface EntityExc extends EJBObject JavaDoc
35 {
36   /**
37    * Exception code for a {@link MyAppException].
38    * This may be used in the flags sent to various methods
39    * here, and in the home interface.
40    */

41   public final int EXC_MYAPPEXCEPTION = 1;
42
43   /**
44    * Exception code for a <code>CreateException</code>.
45    * This may be used in the flags sent to various methods
46    * here, and in the home interface.
47    */

48   public final int EXC_CREATEEXCEPTION = 2;
49
50   /**
51    * Exception code for a <code>EJBException</code>.
52    * This may be used in the flags sent to various methods
53    * here, and in the home interface.
54    */

55   public final int EXC_EJBEXCEPTION = 3;
56
57   /**
58    * Flags exception code mask.
59    */

60   public final int F_EXC_MASK = 0xff;
61
62   /**
63    * Flag telling that an exception should be thrown
64    * <em>after</em> the exception, and not before.
65    */

66   public final int F_THROW_BEFORE = 0x100;
67
68   /**
69    * Flag telling that failure should not happen until the postCreate
70    * method. Ignored for non-create invocations.
71    */

72   public final int F_FAIL_POSTCREATE = 0x200;
73
74   /**
75    * Flag telling that <code>context.setRollbackOnly</code> must be
76    * called before returning.
77    */

78   public final int F_SETROLLBACKONLY = 0x400;
79
80   /**
81    * Text of Exception message thrown.
82    * We check this to make sure we get <i>our</i> Exception.
83    */

84   public final String JavaDoc EXCEPTION_TEXT = "Hello, cruel world.";
85  
86
87   /**
88    * Return the id of this instance.
89    */

90   public int getId()
91     throws RemoteException JavaDoc;
92
93   /**
94    * Return the value of this instance.
95    * This method really works.
96    */

97   public int getVal()
98     throws RemoteException JavaDoc;
99
100   /**
101    * Increment the value of this instance by one.
102    */

103   public void incrementVal()
104     throws RemoteException JavaDoc;
105
106
107   /**
108    * Increment the value of this instance by one, and fail according to
109    * the failure argument afterwards.
110    *
111    * This method has a Required transaction attribute.
112    */

113   public void incrementVal(int flags)
114     throws MyAppException, RemoteException JavaDoc;
115
116 }
117
Popular Tags