#!/bin/sh 
############################################################################### 
#  This is a script for a JEUS environment.                                   # 
#  This uses the following environment variables.                             # 
#                                                                             # 
#  JEUS_HOME       - The root directory of JEUS installed.                    # 
#  JEUS_LIBPATH    - The navtive library for JEUS.                            # 
#  JEUS_LANG       - The language for JEUS.                                   # 
#  VM_TYPE         - The JAVA which JEUS uses to boot.                        # 
#                    Avaiable values are 'hotspot' and 'old'.                 # 
#                                                                             # 
#  USERNAME        - Administrator name                                       # 
#  PASSWORD        - Administrator password                                   # 
#                                                                             # 
#  JAVA_HOME       - Java Home directory.                                     # 
#  JAVA_ARGS       - JVM Parameter(s).                                        # 
#  JAVA_VENDOR     - JVM Vender name.                                         # 
#  SESSION_MEM     - JVM memory argument                                      # 
#                    passed to java for JEUS Session Server                   #
#  TOOL_CLASSPATH  - classpath for console tool.                              #
#                                                                             # 
#  You must set the following variables:                                      # 
#      JEUS_HOME, JAVA_HOME, JAVA_VENDOR                                      # 
#                                                                             # 
#  For additional information, please refer to the JEUS Server Guide or       # 
#  visit the following web sites.                                             #
#                                                                             #
#  - http://www.tmaxsoft.com(English)                                         #
#  - http://www.tmax.co.kr(Korean)                                            #
#  - http://www.tmaxchina.com.cn(Chinese)                                     #
#  - http://www.tmaxsoft.co.jp(Japanese)                                      #
#  - http://technet.tmaxsoft.com(English/Korean)                              #
############################################################################### 

#
# For customizing JEUS environment.
#

# set up JEUS_LIBPATH.
JEUS_LIBPATH="${JEUS_HOME}/lib/system"

# Select language for JEUS. Available value can be ko, en, zh and ja.
JEUS_LANG=ko

# set up SESSION_MEM
SESSION_MEM=-Xmx512m

# set up
JAVA_HOME="/data2/java/jdk1.8.0_192"

# setup JAVA_ARGS.
JAVA_ARGS=

# set up JDK vendor. Possible values are Sun, HP, IBM, etc. Default, Sun.
JAVA_VENDOR=etc


export JEUS_HOME JEUS_LIBPATH JEUS_LANG 
export JEUS_WSDIR JAVA_HOME JAVA_ARGS JAVA_VENDOR SESSION_MEM


###############################################################################
# This part is for booting JEUS automatically.                                #
# BE CAREFUL!! THIS IS ONLY FOR TEST AND DEVELOPMENT ENVIRONMENT.             #
###############################################################################

# Set up administrator name
USERNAME=

# Set up administrator password
PASSWORD=

export USERNAME PASSWORD


###############################################################################
# This part is for JEUS System environment.                                   #
# DO NOT MODIFY except a JEUS expert!!                                        #
###############################################################################

#
# For Console tool.
#
BOOTSTRAP_CLASSPATH="${JEUS_HOME}/lib/system/bootstrap.jar"
BOOTSTRAPPER=jeus.server.Bootstrapper
TOOL_OPTION="-Djeus.tm.not_use=true -Djava.net.preferIPv4Stack=true"

#
# For Java applications' compatibility
#
TOOL_CLASSPATH="${JEUS_HOME}/lib/client/clientcontainer.jar:${JEUS_HOME}/lib/client/jclient.jar:${JEUS_HOME}/lib/client/jclient_jaxb.jar:${JEUS_HOME}/lib/system/activation.jar:${JEUS_HOME}/lib/system/mail.jar:${JEUS_HOME}/lib/system/javaee.jar:${JEUS_HOME}/lib/system/jms.jar:${JEUS_HOME}/lib/system/jeus-ws.jar:${JEUS_HOME}/lib/system/wsdl4j.jar:${JEUS_HOME}/lib/shared/wsit-2.2/webservices-rt-2.2.1.jar:${JEUS_HOME}/lib/system/jmxremote.jar:${JEUS_HOME}/lib/system/commons-cli.jar:${JEUS_HOME}/lib/system/jeus-parser.jar:${JEUS_HOME}/lib/system/jaxb2-basics-runtime.jar"

#
# If VM_TYPE is not set, determine it.
#
if [ -z "$VM_TYPE" ]
then
    case $JAVA_VENDOR in
    Sun)
        VM_TYPE=hotspot
        VM_OPTION=-server

    ;;
    HP)
        VM_TYPE=hotspot
        VM_OPTION=-server

    ;;
    IBM)
        VM_TYPE=old
        VM_OPTION=-Djeus.dispatcher.blocking=true

    ;;
    *)
        VM_TYPE=old
        VM_OPTION=

    esac
fi

#
# Set up JVM native library path.
#
if [ -z "${LD_LIBRARY_PATH}" ]; then
    LD_LIBRARY_PATH=${JEUS_LIBPATH}; export LD_LIBRARY_PATH
else
    LD_LIBRARY_PATH=${JEUS_LIBPATH}:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH
fi

JEUS_LIBPATH=${LD_LIBRARY_PATH}

export SESSION_VERSION TOOL_CLASSPATH VM_OPTION LD_LIBRARY_PATH

TOOL_OPTION="${TOOL_OPTION} -Djava.library.path=${LD_LIBRARY_PATH}"


#
# Check significant variables.
#
if [ -z "$JEUS_HOME" ]
then
    echo "JEUS_HOME is not defined."
    exit 1
fi

if [ -z "$JAVA_HOME" ]
then
    echo "JAVA_HOME is not defined."
    exit 1
fi
