KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > runtime > IASPersistenceManagerDescriptor


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
24 package com.sun.enterprise.deployment.runtime;
25
26 import java.util.*;
27 import java.lang.reflect.*;
28 import java.util.logging.*;
29 import javax.ejb.EJBException JavaDoc;
30 import com.sun.enterprise.util.LocalStringManagerImpl;
31 import com.sun.enterprise.util.TypeUtil;
32 import com.sun.enterprise.deployment.*;
33 import com.sun.enterprise.deployment.util.DOLUtils;
34
35
36 /**
37  * This class contains information about the persistent state
38  * (abstract persistence schema)
39  * for EJB2.0 CMP EntityBeans .
40  *
41  * @author Prashant Jamkhedkar
42  */

43
44 public class IASPersistenceManagerDescriptor extends Descriptor {
45     
46     public static final String JavaDoc PM_IDENTIFIER_DEFAULT = "SunOne"; // NOI18N
47
public static final String JavaDoc PM_VERSION_DEFAULT = "1.0"; // NOI18N
48
public static final String JavaDoc PM_CONFIG_DEFAULT = "myconfig.config";
49     public static final String JavaDoc PM_CLASS_GENERATOR_DEFAULT = "com.sun.jdo.spi.persistence.support.ejb.ejbc.JDOCodeGenerator"; // NOI18N
50
public static final String JavaDoc PM_CLASS_GENERATOR_DEFAULT_OLD = "com.iplanet.ias.persistence.internal.ejb.ejbc.JDOCodeGenerator"; //NOI18N
51
public static final String JavaDoc PM_MAPPING_FACTORY_DEFAULT = "com.sun.ffj.MyFactory"; // NOI18N
52
private String JavaDoc pm_identifier = null;
53     private String JavaDoc pm_version = null;
54     private String JavaDoc pm_config = null;
55     private String JavaDoc pm_class_generator = null;
56     private String JavaDoc pm_mapping_factory = null;
57     
58     private static LocalStringManagerImpl localStrings =
59         new LocalStringManagerImpl(IASPersistenceManagerDescriptor.class);
60     
61     private static final Logger _logger = DOLUtils.getDefaultLogger();
62
63     private Descriptor parentDesc; //the bean whose persistence I describe
64

65
66     public IASPersistenceManagerDescriptor() {
67        pm_identifier = PM_IDENTIFIER_DEFAULT;
68        pm_version = PM_VERSION_DEFAULT;
69        pm_config = PM_CONFIG_DEFAULT;
70        pm_class_generator = PM_CLASS_GENERATOR_DEFAULT;
71        pm_mapping_factory = PM_MAPPING_FACTORY_DEFAULT;
72        _logger.finer("***IASPersistenceManagerDescriptor.constructed done -#-");
73     }
74     
75     /**
76      * The copy constructor.
77      */

78     public IASPersistenceManagerDescriptor(String JavaDoc id, String JavaDoc ver, String JavaDoc conf, String JavaDoc generator, String JavaDoc factory) {
79     
80        pm_identifier = id;
81        pm_version = ver;
82        pm_config = conf;
83        pm_class_generator = generator;
84        pm_mapping_factory = factory;
85
86        _logger.finer("***IASPersistenceManagerDescriptor.constructed done -#-");
87     }
88
89     public String JavaDoc getPersistenceManagerIdentifier() {
90       return pm_identifier;
91     }
92     
93     public void setPersistenceManagerIdentifier(String JavaDoc pm_identifier) {
94         if (pm_identifier == null) {
95             this.pm_identifier = PM_IDENTIFIER_DEFAULT;
96         } else {
97             this.pm_identifier = pm_identifier;
98         }
99     }
100     
101     public String JavaDoc getPersistenceManagerVersion() {
102       return pm_version;
103     }
104     
105     public void setPersistenceManagerVersion(String JavaDoc pm_version) {
106         if (pm_version == null) {
107             this.pm_version = PM_VERSION_DEFAULT;
108         } else {
109             this.pm_version = pm_version;
110         }
111     }
112     
113     public String JavaDoc getPersistenceManagerConfig () {
114       return pm_config;
115     }
116     
117     public void setPersistenceManagerConfig(String JavaDoc pm_config) {
118         if (pm_config == null) {
119             this.pm_config = PM_CONFIG_DEFAULT;
120         } else {
121             this.pm_config = pm_config;
122         }
123     }
124     
125     public String JavaDoc getPersistenceManagerClassGenerator() {
126       return pm_class_generator;
127     }
128     
129     public void setPersistenceManagerClassGenerator(String JavaDoc pm_class_generator) {
130         if (pm_class_generator == null) {
131             this.pm_class_generator = PM_CLASS_GENERATOR_DEFAULT;
132         } else {
133             this.pm_class_generator = pm_class_generator;
134         }
135     }
136     
137     public String JavaDoc getPersistenceManagerMappingFactory() {
138       return pm_mapping_factory;
139     }
140     
141     public void setPersistenceManagerMappingFactory(String JavaDoc pm_mapping_factory) {
142         if (pm_mapping_factory == null) {
143             this.pm_mapping_factory = PM_MAPPING_FACTORY_DEFAULT;
144         } else {
145             this.pm_mapping_factory = pm_mapping_factory;
146         }
147     }
148
149     /**
150      * Called from EjbCMPEntityDescriptor
151      * when some classes in this object are updated.
152      */

153     public boolean classesChanged() {
154         return false;
155     }
156     
157 } // Class
158
Popular Tags