KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > ejb > containers > CommitCEntityContainer


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.ejb.containers;
24
25 import java.lang.reflect.Method JavaDoc;
26 import java.io.*;
27 import java.rmi.RemoteException JavaDoc;
28
29 import javax.ejb.*;
30 import javax.transaction.*;
31
32 import javax.rmi.PortableRemoteObject JavaDoc;
33
34 import java.util.*;
35
36 import com.sun.ejb.*;
37 import com.sun.ejb.portable.ObjrefEnumeration;
38 import com.sun.enterprise.*;
39 import com.sun.enterprise.deployment.*;
40 import com.sun.enterprise.util.LocalStringManagerImpl;
41 import com.sun.enterprise.log.Log;
42 import com.sun.enterprise.appverification.factory.AppVerification;
43
44  /*
45   * This class implements the Commit-Option C as described in
46   * the EJB Specification.
47   *
48   * The CommitOptionC Container extends Entity Container and
49   * hence all the life cycle management is still in Entitycontainer
50   *
51   * @author Mahesh Kannan
52   */

53
54 public class CommitCEntityContainer
55     extends EntityContainer
56 {
57     /**
58      * This constructor is called from the JarManager when a Jar is deployed.
59      * @exception Exception on error
60      */

61     protected CommitCEntityContainer(EjbDescriptor desc, ClassLoader JavaDoc loader)
62         throws Exception JavaDoc
63     {
64         super(desc, loader);
65     }
66     
67     protected EntityContextImpl getReadyEJB(Invocation inv) {
68         Object JavaDoc primaryKey = inv.ejbObject.getKey();
69         return activateEJBFromPool(primaryKey, inv);
70     }
71     
72     protected void createReadyStore(int cacheSize, int numberOfVictimsToSelect,
73             float loadFactor, long idleTimeout)
74     {
75         readyStore = null;
76     }
77     
78     protected void createEJBObjectStores(int cacheSize,
79             int numberOfVictimsToSelect, long idleTimeout) throws Exception JavaDoc
80     {
81         super.defaultCacheEJBO = false;
82         super.createEJBObjectStores(cacheSize, numberOfVictimsToSelect, idleTimeout);
83     }
84     
85     // called from releaseContext, afterCompletion
86
protected void addReadyEJB(EntityContextImpl context) {
87         passivateAndPoolEJB(context);
88     }
89     
90     protected void destroyReadyStoreOnUndeploy() {
91         readyStore = null;
92     }
93     
94     protected void removeContextFromReadyStore(Object JavaDoc primaryKey,
95             EntityContextImpl context)
96     {
97         // There is nothing to remove as we don't have a readyStore
98
}
99     
100 }
101
102
Popular Tags