#!/usr/bin/qsh

# All Rights Reserved * Licensed Materials - Property of IBM
# 5724-I63, 5724-H88, 5655-N01, 5733-W60 (C) COPYRIGHT International Business Machines Corp., 1997,2005
# US Government Users Restricted Rights - Use, duplication or disclosure
# restricted by GSA ADP Schedule Contract with IBM Corp.

# Collect Node Metadata Tool

# env
. $WAS_USER_SCRIPT

# Bootstrap values ...
JAVA_CLASS=com.ibm.ws.admin.core.CollectManagedObjectMetadata

# For debugging the launcher itself
# DEBUG="-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777"

# Setup the initial java invocation;

DELIM=" "

#second parm is optional node name
NODE=$WAS_NODE
if [ "$2" != "" ] ; then
   NODE=$2 
fi

#Common args...
D_ARGS="-Dosgi.install.area="$WAS_HOME" $DELIM \
	-Dosgi.configuration.area="$USER_INSTALL_ROOT"/configuration $DELIM \
	-Dws.ext.dirs="$WAS_EXT_DIRS" $DELIM \
 	-Dlocal.cell="$WAS_CELL" $DELIM \
	-Dlocal.node=$NODE $DELIM \
	-Dwas.install.root="$WAS_HOME" $DELIM \
	-Duser.install.root="$USER_INSTALL_ROOT" $DELIM \
	-Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager $DELIM \
	-Dwas.repository.root="$CONFIG_ROOT" $DELIM \
	-Djava.util.logging.configureByServer=true"
X_ARGS=-Xbootclasspath/p:"$WAS_BOOTCLASSPATH"
WAS_CLASSPATH="$WAS_HOME"/properties:"$WAS_HOME"/lib/startup.jar:"$WAS_HOME"/lib/bootstrap.jar


${JAVA_HOME}/bin/java $X_ARGS \
  $DEBUG \
  $D_ARGS \
  -classpath "$WAS_CLASSPATH" \
  com.ibm.wsspi.bootstrap.WSPreLauncher -nosplash -application com.ibm.ws.bootstrap.WSLauncher \
  $JAVA_CLASS -add $1
