/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
/**
* Defines various global configuration for the running GlassFish instance.
*
* <p>
* This primarily replaces all the system variables in V2.
*
* @author Jerome Dochez
* @author Byron Nevins
*/
/** folder where all generated code like compiled jsps, stubs is stored */
/** folder where the configuration of this instance is stored */
/** init file name */
/**
* Compute all the values per default.
*/
public ServerEnvironmentImpl() {
}
// the getParentFile() that we do later fails to work correctly if
// root is for example "new File(".")
asenv = new ASenvPropertyReader();
}
/**
* This is where the real initialization happens.
*/
public void postConstruct() {
// todo : dochez : this will need to be reworked...
if (installRoot == null) {
// Sahoo: This is truely a bad piece of code. During unit testing, we find an empty StartupContext.
// To be consistent with earlier code (i.e., code that relied on StartupContext.getRootDirectory()),
// I am setting user.dir as installRoot.
}
// default
} else {
if (instanceRoot == null) {
// In client container, instanceRoot is not set. It is a different question altogether as to why
// an object called ServerEnvironmentImpl is at all active in client runtime. To be consistent
// with earlier code, we use installRoot as instanceRoot.
}
}
}
/*
* bnevins 12/12/11
* The following chunk of code sets things like hostname to be a file under instance root
* I.e. it's crazy. It's 1 hour until SCF so I'll just fix the current problem which is a NPE
* if the value is null.
* At any rate the weird values that get set into System Properties get un-done at
* the line of code in bootstrap (see end of this comment). It's easy to trace just step out of this method
* in a debugger
* createGlassFish(gfKernel, habitat, gfProps.getProperties())
*/
continue;
if (!location.isAbsolute()) {
location = new File(asenv.getProps().get(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY), entry.getValue());
}
}
// ugly code because domainName & instanceName are final...
if (!ok(s)) {
}
domainName = s;
if (!ok(s)) {
instanceName = "server";
}
else {
instanceName = s;
}
// bnevins IT 10209
// bnevins Apr 2010 adding clustering support...
try {
if(typeString != null)
}
catch(Exception e) {
// already handled above...
}
}
// XXX - many of these methods should be on ServerEnvironment
return domainName;
}
return root;
}
/**
* @return the instance root
* @deprecated As of GlassFish 3.1 replaced with {@link #getInstanceRoot() }
*/
return getInstanceRoot();
}
return startupContext;
}
/**
* Gets the directory to store configuration.
*/
}
/**
* Gets the directory to store deployed applications
* Normally {@code ROOT/applications}
*/
}
/**
* Gets the directory to store generated stuff.
*/
}
/**
* Gets the <tt>init.conf</tt> file.
*/
}
/**
* Gets the directory for hosting user-provided jar files.
*/
}
}
}
/**
* Returns the path for compiled JSP Pages from an application
* that is deployed on this instance. By default all such compiled JSPs
* should lie in the same folder.
*/
}
/**
* Returns the path for policy files for applications
* deployed on this instance.
*/
}
/*
* XXX - no one is using these methods, so I'm commenting them out
* for now. When they're needed, they should probably be added to
* the ServerEnvironment Interface.
*
public String getJavaWebStartPath() {
return null;
}
public String getApplicationBackupRepositoryPath() {
return null;
}
public String getInstanceClassPath() {
return null;
}
*/
}
/** Returns the folder where the admin console application's folder (in the
* name of admin console application) should be found. Thus by default,
* it should be: [install-dir]/lib/install/applications. No attempt is made
* to check if this location is readable or writable.
* @return java.io.File representing parent folder for admin console application
* Never returns a null
*/
return (agp);
}
}
}
}
}
return status;
}
}
public boolean isEmbedded() {
}
return serverType;
}
/**
* Every server has a name that can be found in the server element in domain.xml
* @return the name of this server i.e. "my" name
*/
return instanceName;
}
/**
* Am I a running GlassFish server instance?
* @return true if we are an instance
*/
public boolean isInstance() {
}
/**
* Am I a running GlassFish DAS server?
* @return true if we are a DAS
*/
public boolean isDas() {
}
}
}