de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * The contents of this file are subject to the terms
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * of the Common Development and Distribution License
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * (the License). You may not use this file except in
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * compliance with the License.
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * You can obtain a copy of the License at
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * https://opensso.dev.java.net/public/CDDLv1.0.html or
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * See the License for the specific language governing
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * permission and limitations under the License.
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * When distributing Covered Code, include this CDDL
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * Header Notice in each file and include the License file
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * If applicable, add the following below the CDDL Header,
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * with the fields enclosed by brackets [] replaced by
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * your own identifying information:
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * "Portions Copyrighted [year] [name of copyright owner]"
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * $Id: StartupScriptBase.java,v 1.5 2008/06/25 05:52:21 qcheng Exp $
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperpackage com.sun.identity.agents.tools.weblogic.v10;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.util.ConfigUtil;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.util.Debug;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.util.FileEditor;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.util.FileUtils;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.util.DeletePattern;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.configurator.IStateAccess;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.configurator.InstallConstants;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * This task configure setAgentEvn script.
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperpublic class StartupScriptBase implements InstallConstants, IConfigKeys {
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * Set classpath to j2ee_agents/am_wl10_agent/lib/agent.jar:
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * j2ee_agents/weblogic_v10_agent/lib/openssoclientsdk.jar:
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * j2ee_agents/weblogic_v10_agent/agent_xxx/config:
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper protected String getAgentClasspathEntries(IStateAccess stateAccess) {
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper String[] entries = getAgentClasspathArrayEntries(stateAccess);
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper private String[] getAgentClasspathArrayEntries(IStateAccess stateAccess) {
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper String localeDir = ConfigUtil.getLocaleDirPath();
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper String instanceName = stateAccess.getInstanceName();
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper String instanceConfigDirPath = sb.toString();
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper Debug.log("StartupScriptBase.getAgentClasspathEntries(): " +
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper protected String getAgentJavaOptions(IStateAccess stateAccess) {
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper Debug.log("StartupScriptBase.getAgentJavaOptions(): options: "
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper protected String getAgentEnvScriptPath(IStateAccess stateAccess) {
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper String osName = System.getProperty(STR_OS_NAME_PROPERTY);
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper (String) stateAccess.get(STR_KEY_STARTUP_SCRIPT_DIR);
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper String instanceName = (String) stateAccess.get(STR_KEY_SERVER_NAME);
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper if (osName.toLowerCase().startsWith(STR_WINDOWS)) {
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper startupscriptDir + FILE_SEP + AGENT_ENV + "_" +
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper agentEnvScriptFile = FileUtils.replaceBackWithForward(destFile);
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper private boolean getCoexistFlag(IStateAccess stateAccess) {
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper (String) stateAccess.get(STR_AM_COEXIST_KEY);
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper Debug.log("StartupScriptBase.getCoexistFlag(): " +
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper "Co-exist flag in Install State: " +
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper (strCoexistFlag.equalsIgnoreCase("true") ? true : false);
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper this.coexistFlag = new Boolean(coexistBoolean);
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper Debug.log("StartupScriptBase.getCoexistFlag(): Co-exist flag: " +
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper public static final String DEFAULT_INSTANCE_NAME = "AdminServer";