Methods Summary |
---|
public static java.sql.Connection | getConnection(java.lang.String name)Get a Connection from the resource specified by the JNDI name
of a CMP resource.
This connection is aquired from a special PM resource which allows
to use its connections outside of a business method invocation.
The deployment processing is required to use only those connections.
if (logger.isLoggable(logger.FINE)) {
logger.fine("ejb.DeploymentHelper.getconnection", name); //NOI18N
}
return ConnectorRuntime.getRuntime().getConnection(name);
|
public static java.lang.String | getDDLNamePrefix(java.lang.Object info)Returns name prefix for DDL files extracted from the info instance by the
Sun-specific code.
StringBuffer rc = new StringBuffer();
if (info instanceof BundleDescriptor) {
BundleDescriptor bundle = (BundleDescriptor)info;
rc.append(bundle.getApplication().getRegistrationName());
Application application = bundle.getApplication();
if (!application.isVirtual()) {
String modulePath = bundle.getModuleDescriptor().getArchiveUri();
int l = modulePath.length();
// Remove ".jar" from the module's jar name.
rc.append(DatabaseConstants.NAME_SEPARATOR).
append(modulePath.substring(0, l - 4));
}
} // no other option is available at this point.
return (rc.length() == 0)? DEFAULT_NAME : rc.toString();
|
private static void | handleUnexpectedInstance(java.lang.String name, java.lang.Object value)Create a RuntimeException for unexpected instance returned
from JNDI lookup.
RuntimeException e = new JDOFatalUserException(
I18NHelper.getMessage(messages,
"ejb.jndi.unexpectedinstance", //NOI18N
name, value.getClass().getName()));
logger.severe(e.toString());
throw e;
|
public static boolean | isJavaToDatabase(com.sun.enterprise.deployment.EjbBundleDescriptor bundle)Returns javatodb flag for this EjbBundleDescriptor
Properties userPolicy = bundle.getCMPResourceReference()
.getSchemaGeneratorProperties();
return isJavaToDatabase(userPolicy);
|
public static boolean | isJavaToDatabase(java.util.Properties prop)Returns boolean value for the DatabaseConstants.JAVA_TO_DB_FLAG
flag in this Properties object.
if (prop != null) {
String value = prop.getProperty(DatabaseConstants.JAVA_TO_DB_FLAG);
if (! StringHelper.isEmpty(value)) {
if (logger.isLoggable(Logger.FINE))
logger.fine(DatabaseConstants.JAVA_TO_DB_FLAG + " property is set."); // NOI18N
return Boolean.valueOf(value).booleanValue();
}
}
return false;
|