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 /** 25 * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms. 26 * 27 * Copyright 2000-2001 by iPlanet/Sun Microsystems, Inc., 28 * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. 29 * All rights reserved. 30 */ 31 package com.sun.enterprise.server; 32 33 import javax.naming.InitialContext; 34 35 import com.sun.enterprise.config.ConfigContext; 36 import com.sun.enterprise.config.ConfigException; 37 import com.sun.enterprise.config.serverbeans.Server; 38 import com.sun.enterprise.instance.InstanceEnvironment; 39 import com.sun.enterprise.server.pluggable.PluggableFeatureFactory; 40 41 import com.sun.enterprise.InvocationManager; 42 import com.sun.enterprise.admin.monitor.registry.MonitoringRegistry; 43 44 /** 45 * ServerContext interface: the server-wide runtime environment created by 46 * ApplicationServer and shared by its subsystems such as the web container 47 * or EJB container. 48 */ 49 public interface ServerContext { 50 51 /** 52 * Get the server command-line arguments 53 * 54 * @return the server command-line arguments 55 */ 56 public String[] getCmdLineArgs(); 57 58 /** 59 * Get a factory for supported pluggable features. The server can support 60 * many pluggable features in different editions. This factory allows access 61 * to specialized implementation of features. 62 */ 63 public PluggableFeatureFactory getPluggableFeatureFactory(); 64 65 /** XXX: begin should move these to Config API */ 66 67 /** 68 * Get server install root 69 * 70 * @return the server install root 71 */ 72 public String getInstallRoot(); 73 74 /** 75 * Get the server instance name 76 * 77 * @return the server instance name 78 */ 79 public String getInstanceName(); 80 81 /** 82 * Get a URL representation of server configuration 83 * 84 * @return the URL to the server configuration 85 */ 86 public String getServerConfigURL(); 87 88 /** XXX: end should move these to Config API */ 89 90 /** 91 * Get the server configuration context. 92 * 93 * @return the config context for this server instance 94 */ 95 public ConfigContext getConfigContext(); 96 97 /** 98 * Get the server configuration bean. 99 * 100 * @return the server config bean 101 */ 102 public com.sun.enterprise.config.serverbeans.Server getConfigBean() 103 throws ConfigException; 104 105 /** 106 * Get the initial naming context. 107 * 108 * @return the initial naming context 109 */ 110 public InitialContext getInitialContext(); 111 112 /** 113 * Get the classloader that loads .jars in $instance/lib and classes 114 * in $instance/lib/classes. 115 * 116 * @return the common class loader for this instance 117 */ 118 public ClassLoader getCommonClassLoader(); 119 120 /** 121 * Returns the shared class loader for this server instance. 122 * 123 * @return the shared class loader 124 */ 125 public ClassLoader getSharedClassLoader(); 126 127 /** 128 * Get the parent class loader for the life cycle modules. 129 * 130 * @return the parent class loader for the life cycle modules 131 */ 132 public ClassLoader getLifecycleParentClassLoader(); 133 134 /** 135 * Returns the environment object for this instance. 136 * 137 * @return the environment object for this server instance 138 */ 139 public InstanceEnvironment getInstanceEnvironment(); 140 141 /** 142 * get the J2EE Server invocation manager 143 * 144 * @return InvocationManager 145 */ 146 public InvocationManager getInvocationManager(); 147 148 /** 149 * get the default domain name 150 * 151 * @return String default domain name 152 */ 153 public String getDefaultDomainName(); 154 155 /** 156 * Returns the MonitoringRegistry implementation used for registration of 157 * monitoring stats. 158 * @return instance of MonitoringRegistry 159 */ 160 public MonitoringRegistry getMonitoringRegistry(); 161 } 162