KickJava   Java API By Example, From Geeks To Geeks.

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


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: ItfEjb2LocalClient.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 javax.ejb.CreateException JavaDoc;
29 import javax.ejb.RemoveException JavaDoc;
30 import javax.naming.NamingException JavaDoc;
31
32 /**
33  * Is a client with ejb 2.1 view.
34  * @author Gisele Pinheiro Souza
35  * @author Eduardo Studzinski Estima de Castro
36  */

37 public interface ItfEjb2LocalClient {
38
39     /**
40      * The default bean code.
41      */

42     int DEFAULT_CODE = 1;
43
44     /**
45      * The default bean name.
46      */

47     String JavaDoc DEFAULT_NAME = "test";
48
49     /**
50      * Returns the bean home object.
51      * @return the home object.
52      */

53     SimpleEjb2LocalHome getBeanHome();
54
55     /**
56      * Returns the bean JNDI address.
57      * @return the JNDI address.
58      */

59     String JavaDoc getBeanName();
60
61     /**
62      * Creates a bean using the home object that was injected. The bean is
63      * created with the method ejbCreate() without the annotation init.
64      * @throws CreateException if an error occurs during the creation.
65      */

66     void createWithIntParameter() throws CreateException JavaDoc;
67
68     /**
69      * Creates a bean using the home object that was injected. The bean is
70      * created with the method init() with the annotation init.
71      * @throws CreateException if an error occurs during the creation.
72      */

73     void createWithStrParameter() throws CreateException JavaDoc;
74
75     /**
76      * Gets an instance of the home object by a lookup.After that, creates an
77      * instance of the bean.
78      * @throws NamingException if an error during the lookup occurs.
79      * @throws CreateException if an error occurs during the creation.
80      */

81     void getBeanByLookup() throws NamingException JavaDoc, CreateException JavaDoc;
82
83     /**
84      * Creates a bean and after that, removes it.
85      * @throws RemoveException if the bean can not be deleted.
86      * @throws CreateException if an error occurs during the creation.
87      */

88     void removeObject() throws RemoveException JavaDoc, CreateException JavaDoc;
89
90     /**
91      * Verifies if the identity for stateful bean is correct. An instance of
92      * stateful bean can not be considered identical to other instance.
93      * @throws CreateException if an error occurs during the creation.
94      */

95     void verifyIdentity() throws CreateException JavaDoc;
96
97     /**
98      * Verifies if the exception correct is thrown when the method
99      * getPrimaryKey() is called.
100      * @throws CreateException if a problem during the creation occurs.
101      */

102     void verifyGetPrimaryKey() throws CreateException JavaDoc;
103
104 }
105
Popular Tags