/**
+ * Return the global naming resources context.
+ */
+ public javax.naming.Context getGlobalNamingContext();
+
+
+ /**
* Return the port number we listen to for shutdown commands.
*/
public int getPort();
/**
* Return the global naming resources context.
*/
+ @Override
public javax.naming.Context getGlobalNamingContext() {
return (this.globalNamingContext);
// Acquire global JNDI resources if available
Server server = ((Engine)host.getParent()).getService().getServer();
- if ((server != null) && (server instanceof StandardServer)) {
- global = ((StandardServer) server).getGlobalNamingContext();
+ if (server != null) {
+ global = server.getGlobalNamingContext();
}
// Calculate the directory into which we will be deploying applications
import javax.sql.DataSource;
import org.apache.catalina.LifecycleException;
-import org.apache.catalina.core.StandardServer;
import org.apache.naming.ContextBindings;
/**
context = ContextBindings.getClassLoader();
context = (Context) context.lookup("comp/env");
} else {
- context =
- ((StandardServer)getServer()).getGlobalNamingContext();
+ context = getServer().getGlobalNamingContext();
}
DataSource dataSource = (DataSource)context.lookup(dataSourceName);
return dataSource.getConnection();
import org.apache.catalina.User;
import org.apache.catalina.UserDatabase;
import org.apache.catalina.Wrapper;
-import org.apache.catalina.core.StandardServer;
import org.apache.tomcat.util.ExceptionUtils;
protected void startInternal() throws LifecycleException {
try {
- Context context =
- ((StandardServer)getServer()).getGlobalNamingContext();
+ Context context = getServer().getGlobalNamingContext();
database = (UserDatabase) context.lookup(resourceName);
} catch (Throwable e) {
ExceptionUtils.handleThrowable(e);