/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: ServerXMLBase.java,v 1.3 2008/12/16 00:15:34 leiming Exp $
*
*/
/**
* Base class to configure server.xml. Both configure and unconfigure of
* server.xml tasks use this class.
*
*/
/**
* Common function to find the server:Process element with server instance
* name
*/
try {
if (jvmEntries != null) {
cpElem = jvmEntries;
}
}
}
}
} else {
"ServerXMLBase.findClassPathElement() - failed to find "
+ " jvmEntries element for "
+ " server instance = "
+ serverInst);
}
+ " jvmEntries element for " + " server instance = "
+ serverInst, ex);
}
return cpElem;
}
/**
* The element is in either of two locations - either its a root element or
* its a immediate child of the root element. WAS changes the process:Server
* element from immediate child to root element if any changes are made to
* this XML file through console and there is only one instance of the
* server in the file
*
*/
+ "Root element is the server:Process element, name = "
serverElem = parent;
} else {
if (serverElem != null) {
+ "Found server:Process element as an immediate child");
}
}
return serverElem;
}
/**
* Generic function to get an element with attribute name and value
*/
for (int i = 0; i < count; i++) {
break;
}
}
}
return result;
}
/*
* To simplify the logic, the function first look classpath as an attr and
* then as an element
*/
boolean status = true;
try {
// store in a temp variable for later processing
if (count >= 1) {
+ "removed XML attr "
+ "classpath"
+ " from jvmEntries element : attr count = " + count);
if ((preAgentClasspath != null)
"ServerXMLBase.configureClasspath() - storing pre "
+ "agent classpath in install state = "
} else {
// empty value
}
} else {
// classpath not present as attribute but as element
+ "attribute not present,"
+ "nothing to do : attr count = " + count);
}
status = false;
}
return status;
}
/**
* Element gets updated or added
*/
boolean status = true;
try {
// Blindly add a new element for agent classpath even if there are
// n already existing classpath elements (n > 0)
if (jvmEntries != null) {
}
+ " failed to update classpath in element" + " with ex : ",
ex);
status = false;
}
return status;
}
/*
* Generic function to add new classpath element
*/
boolean status = true;
try {
+ "New classpath element added " +
+ "exception caught ", ex);
status = false;
}
return status;
}
/**
*
* To simplify the logic, will first look for classpath as attr and then as
* element
*
*/
boolean status = true;
try {
// Store in a temp variable for later processing
// We have to update as an attribute if this check is true
+ "to update classpath as an attribute");
+ "setting pre agent classpath =" + preAgentCp);
} else {
+ "setting agent classpath to empty value");
}
} else {
// unconfigure classpath as an element
// WAS can create more than one classpath element
// Be sure this is the one to update
if ((classpathElem != null)
+ "found "
+ "classpath element to unconfigure ="
+ classpathElem.toXMLString());
// Never know if there was pre agent classpath as
// attr before agent install
if ((preAgentClasspath != null)
"ServerXMLBase.unConfigureClasspath() - "
+ "classpath "
+ " element updated with = "
} else {
// remove the element since no pre agent
// classpath found
"ServerXMLBase.unConfigureClasspath() - "
+ "classpath element deleted, no previous "
+ "entry found ");
}
break;
}
}
}
}
status = false;
}
return status;
}
/*
* Function to append agent classpath to pre existing classpath
*/
for (int i = 0; i < count; i++) {
}
+ resultClasspath);
return resultClasspath;
}
/*
* Function to get agent classpath
*/
for (int i = 0; i < count; i++) {
if (i < (count - 1)) {
}
}
+ resultClasspath);
return resultClasspath;
}
/*
* Helper function to get agent classpath entries as an array of strings
*/
return entries;
}
/*
* get new JVM options
*/
return STR_IBM_ENC_JVM_OPTIONS_VALUE +
}
/*
* add IBM JVM options
*/
boolean status = true;
try {
+ " IBM JVM options already exist, "
+ " skip adding them.");
return true;
}
}
+ "removed XML attribute JVM Options"
+ " from jvmEntries element.");
+ "added IBM JVM options.");
+ " failed to add JVM options with exception : ", ex);
status = false;
}
return status;
}
/*
* remove IBM JVM options
*/
boolean status = true;
try {
+ " IBM JVM options do not exist, "
+ " skip removing them.");
return true;
}
+ "removed XML attribute JVM Options"
+ " from jvmEntries element.");
+ "removed IBM JVM options.");
+ " failed to remove JVM options with exception : ", ex);
status = false;
}
return status;
}
"-DamKeyGenDescriptor.provider=IBMJCE "
+ "-DamCryptoDescriptor.provider=IBMJCE "
+ "-DamRandomGenProvider=IBMJCE ";
"-DLOG_COMPATMODE=Off ";
"-Djava.util.logging.config.file=";
}