KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ejb > container > BeanFactory


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@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: BeanFactory.java,v 1.8 2004/12/15 14:36:58 durieuxp Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas_ejb.container;
27
28 import java.util.Hashtable JavaDoc;
29
30 import javax.naming.InitialContext JavaDoc;
31
32 import org.objectweb.jonas_ejb.deployment.api.BeanDesc;
33 import org.objectweb.transaction.jta.TransactionManager;
34
35
36 /**
37  * Interface to the Bean Factories
38  * used by the Container, JMX, or generic parts of this package.
39  * @author Philippe Durieux, Philippe Coq (Bull)
40  */

41 public interface BeanFactory {
42
43     /**
44      * get the bean name
45      * @return The name of the bean
46      */

47     String JavaDoc getEJBName();
48
49     /**
50      * Get the Deployement descriptor of this Ejb
51      * @return BeanDesc The bean deployment descriptor
52      */

53     BeanDesc getDeploymentDescriptor();
54
55     /**
56      * Get the size of the instance pool for this bean
57      * @return number of instances in the pool
58      */

59     int getPoolSize();
60
61     /**
62      * stop this EJB (unregister it in JNDI)
63      */

64     void stop();
65
66     /**
67      * synchronize bean instances if needed
68      */

69     void sync();
70
71     /**
72      * reduce cache of instances
73      */

74     void reduceCache();
75
76     /**
77      * returns the home if exist or null if not
78      * @return Home for that bean, if exists.
79      */

80     JHome getHome();
81
82     /**
83      * returns the local home if exist or null if not
84      * @return LocalHome for that bean, if exists.
85      */

86     JLocalHome getLocalHome();
87
88     /**
89      * returns the TransactionManager
90      * @return The Transaction Manager
91      */

92     TransactionManager getTransactionManager();
93
94     /**
95      * Returns the JContainer
96      * @return The Container where the bean lives.
97      */

98     JContainer getContainer();
99
100     /**
101      * Return the JNDI Environment
102      * @return List of Environment used by the bean
103      */

104     Hashtable JavaDoc getEnv();
105
106     /**
107      * Returns the InitialContext
108      * @return JNDI Initial Context
109      */

110     InitialContext JavaDoc getInitialContext();
111
112     /**
113      * Init the pool of instances
114      */

115     void initInstancePool();
116 }
117
Popular Tags