KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > stateful > containermanaged > ejb2view > ItfEjb2Client


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: ItfEjb2Client.java 981 2006-07-28 14:16:22Z pinheirg $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.ejb2view;
27
28 import java.rmi.RemoteException JavaDoc;
29
30 import javax.ejb.CreateException JavaDoc;
31 import javax.ejb.RemoveException JavaDoc;
32 import javax.naming.NamingException JavaDoc;
33
34 /**
35  * Has the 2.1 client view of the ejb.
36  * @author Gisele Pinheiro Souza
37  * @author Eduardo Studzinski Estima de Castro
38  */

39 public interface ItfEjb2Client {
40
41     /**
42      * The bean code.
43      */

44      int DEFAULT_CODE = 2;
45
46     /**
47      * The bean name.
48      */

49      String JavaDoc DEFAULT_NAME = "testClient";
50
51     /**
52      * Creates a bean using the home object that was injected. The bean is
53      * created with the method ejbCreate() without the annotation init.
54      * @throws CreateException if an error occurs during the creation.
55      * @throws RemoteException if system level error occurs.
56      */

57     void createWithoutParameters() throws CreateException JavaDoc, RemoteException JavaDoc;
58
59     /**
60      * Creates a bean using the home object that was injected. The bean is
61      * created with the method init() witho the annotation init.
62      * @throws CreateException if an error occurs during the creation.
63      * @throws RemoteException if system level error occurs.
64      */

65     void createWithParameters() throws CreateException JavaDoc, RemoteException JavaDoc;
66
67     /**
68      * Gets an instance of the home object by a lookup.After that, creates an
69      * instance of the bean.
70      * @throws NamingException if an error during the lookup occurs.
71      * @throws CreateException if an error occurs during the creation.
72      * @throws RemoteException if system level error occurs.
73      */

74     void getBeanByLookup() throws NamingException JavaDoc, CreateException JavaDoc, RemoteException JavaDoc;
75
76     /**
77      * Creates a bean and after that, removes it.
78      * @throws RemoveException if the bean can not be deleted.
79      * @throws RemoteException if a system level error occurs.
80      * @throws CreateException if an error occurs during the creation.
81      */

82     void removeObject() throws RemoteException JavaDoc, RemoveException JavaDoc, CreateException JavaDoc;
83
84     /**
85      * Tries to get the ejbMetaData and uses the method isStatelessSession in
86      * the metadata.
87      * @throws RemoteException if a system level error occurs.
88      */

89     void getEJBMetaData() throws RemoteException JavaDoc;
90
91     /**
92      * Verifies if the identity for stateful bean is correct. An instance of
93      * stateful bean can not be considered identical to other instance.
94      * @throws RemoteException if a system level error occurs.
95      * @throws CreateException if an error occurs during the creation.
96      */

97     void verifyIdentity() throws CreateException JavaDoc, RemoteException JavaDoc;
98
99     /**
100      * Verifies if the exception correct is thrown when the method
101      * getPrimaryKey() is called.
102      * @throws CreateException if a problem during the creation occurs.
103      * @throws RemoteException if a system level error occurs.
104      */

105      void verifyGetPrimaryKey() throws RemoteException JavaDoc, CreateException JavaDoc;
106 }
107
Popular Tags