锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
1.鏂板緩鎺ュ彛
package demo.spring;
import javax.jws.WebService;
@WebService
public interface HelloWorld {
String sayHi(String text);
}
// END SNIPPET: service
2.鎺ュ彛瀹炵幇
package demo.spring;
import javax.jws.WebService;
@WebService(endpointInterface = "demo.spring.HelloWorld")
public class HelloWorldImpl implements HelloWorld {
public String sayHi(String text) {
return "Hello " + text;
}
package demo.spring.client;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import demo.spring.HelloWorld;
public final class Client {
private Client() {
}
public static void main(String args[]) throws Exception {
// START SNIPPET: client
ClassPathXmlApplicationContext context
= new ClassPathXmlApplicationContext(new String[] {"demo/spring/client/client-beans.xml"});
HelloWorld client = (HelloWorld)context.getBean("client");
String response = client.sayHi("Joe");
System.out.println("Response: " + response);
System.exit(0);
// END SNIPPET: client
}
}
client-beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- START SNIPPET: beans -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
<bean id="client" class="demo.spring.HelloWorld"
factory-bean="clientFactory" factory-method="create"/>
<bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass" value="demo.spring.HelloWorld"/>
<property name="address" value="http://localhost:8080/example/jws/HelloWorld"/>
</bean>
</beans>
<!-- END SNIPPET: beans -->
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- START SNIPPET: beans -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxws:endpoint
id="helloWorld"
implementor="demo.spring.HelloWorldImpl"
address="/HelloWorld" />
</beans>
<!-- END SNIPPET: beans -->
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>example</display-name>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<display-name>CXF Servlet</display-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/jws/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
鏂板緩涓涓璞ccount,渚泈ebservices璋冪敤
package webServices;
public class Account {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
鏂板緩涓涓帴鍙?br /> package webServices;
public interface MathService {
Account sayHello(Account account);
}
瀹炵幇綾?br /> package webServices;
public class MathServiceImpl implements MathService{
@Override
public Account sayHello(Account account) {
account.setName("hello"+account.getName());
return account;
}
}
鏂板緩WEB-INF/spring.xml,涓涓畝鍗昩ean閰嶇疆
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="mathBean" class="webServices.MathServiceImpl"/>
</beans>
鏂板緩WEB-INF/xfire-servlet.xml,webservice閰嶇疆鐩稿叧淇℃伅
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/MathService">
<ref bean="math" />
</entry>
</map>
</property>
</bean>
<bean id="math"
class="org.codehaus.xfire.spring.remoting.XFireExporter">
<property name="serviceFactory">
<ref bean="xfire.serviceFactory" />
</property>
<property name="xfire">
<ref bean="xfire" />
</property>
<!-- spring閰嶇疆瀹炵幇鎺ュ彛綾?->
<property name="serviceBean">
<ref bean="mathBean" />
</property>
<!-- 鎺ュ彛綾?->
<property name="serviceClass">
<value>webServices.MathService</value>
</property>
</bean>
</beans>
淇敼web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>test</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring.xml
classpath:/org/codehaus/xfire/spring/xfire.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>xfire</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>xfire</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
鍚姩web搴旂敤璁塊棶http://localhost:8080/test/MathService?wsdl鍙互鐪嬭webservice閰嶇疆淇℃伅
JAVA瀹㈡埛绔祴璇?br />
package client;
import java.net.MalformedURLException;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.binding.ObjectServiceFactory;
import webServices.Account;
import webServices.MathService;
public class Client {
/** *//**
* @param args
*/
public static void main(String[] args){
String serviceURL="http://localhost:8080/test/MathService";
Service serviceModel = new ObjectServiceFactory().create(MathService.class,null,serviceURL,null);
XFireProxyFactory serviceFactory = new XFireProxyFactory();
MathService service = null;
try {
service = (MathService) serviceFactory.create(serviceModel, serviceURL);
Account account=new Account();
account.setName("example");
System.out.println(service.sayHello(account).getName());
} catch (MalformedURLException e){
e.printStackTrace();
}
}
}
vs2005閲岄潰璋冪敤澧炲姞web寮曠敤
瀵煎叆鐩稿叧綾?鐩存帴new 鐢?
import example.localhost.*;
AccountDao accountService = new AccountDao();
textBox3.set_Text(accountService.sayHello("hhhhh"));
package cn.ynzc.certificateQuery.hibernate;
import java.io.Serializable;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import cn.ynzc.certificateQuery.dao.Dao;
public class DaoImpl extends HibernateDaoSupport implements Dao {
public List findAllBy(final Class clazz, final String name,
final Object value) {
return (List) getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Criteria criteria = session.createCriteria(clazz);
criteria.add(Restrictions.eq(name, value));
return criteria.list();
}
});
}
public List findAllBy(final Class clazz, final Map filter, final Map sort,
final int pageNo, final int pageSize) {
return (List) getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Criteria criteria = session.createCriteria(clazz);
criteriaFilter(criteria, filter);
criteriaSort(criteria, sort);
if (pageNo != -1) {
criteria.setFirstResult(pageNo - 1 > 0 ? (pageNo - 1)
* pageSize : 0);
criteria.setMaxResults(pageSize);
}
return criteria.list();
}
});
}
private void criteriaFilter(Criteria criteria, Map filter) {
if (MapUtils.isNotEmpty(filter)) {
for (Iterator iterator = filter.keySet().iterator(); iterator
.hasNext();) {
String fieldName = (String) iterator.next();
Object value = filter.get(fieldName);
if (fieldName.indexOf('.') > 0) {
String[] sArray = StringUtils.split(fieldName, '.');
for (int i = 0; i < sArray.length; i++) {
if (i == 0)
criteria.createAlias(sArray[i], "alias_"
+ sArray[i]);
else if (i > 0 && i < sArray.length - 1)
criteria.createAlias("alias_" + sArray[i - 1] + "."
+ sArray[i], "alias_" + sArray[i]);
else
fieldName = "alias_" + sArray[i - 1] + "."
+ sArray[i];
}
}
criteria.add(value == null ? Restrictions.isNull(fieldName)
: Restrictions.eq(fieldName, value));
}
}
}
private void criteriaSort(Criteria criteria, Map sort) {
if (MapUtils.isNotEmpty(sort)) {
for (Iterator iterator = sort.keySet().iterator(); iterator
.hasNext();) {
String key = (String) iterator.next();
criteria.addOrder(StringUtils.equalsIgnoreCase("asc",
(String) sort.get(key)) ? Order.asc(key) : Order
.desc(key));
}
}
}
public Object findBy(final Class clazz, final String name,
final Object value) {
return getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Criteria criteria = session.createCriteria(clazz);
criteria.add(Restrictions.eq(name, value));
List list = criteria.list();
return list == null || list.isEmpty() ? null : list.get(0);
}
});
}
public Object getObject(Class clazz, Serializable id) {
return getHibernateTemplate().get(clazz, id);
}
public List getObjects(Class clazz) {
return getHibernateTemplate().loadAll(clazz);
}
public void removeObject(Object object) {
getHibernateTemplate().delete(object);
}
public void removeObject(Class clazz, Serializable id) {
getHibernateTemplate().delete(getObject(clazz, id));
}
public void removeObject(Collection collection) {
getHibernateTemplate().deleteAll(collection);
}
public Serializable saveObject(Object object) {
return getHibernateTemplate().save(object);
}
public int total(final Class clazz, final Map filter) {
return ((Number) getHibernateTemplate().execute(
new HibernateCallback() {
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Criteria criteria = session.createCriteria(clazz);
criteriaFilter(criteria, filter);
criteria.setProjection(Projections.rowCount());
criteria.setCacheable(true);
return criteria.uniqueResult();
}
})).intValue();
}
public void updateObject(Object object) {
getHibernateTemplate().update(object);
}
}
# Source function library.
INITD=/etc/rc.d/init.d
. $INITD/functions
# Source system profile.
if [ -r /etc/profile ] ; then . /etc/profile ; fi
ORA_SID=mmwy
ORA_USER=oracle
ORA_BASE=/u01/app/oracle
ORA_HOME=${ORA_BASE}/product/10g
BASH_ENV=/home/oracle/.bashrc
case "$1" in
聽聽聽 'start')
聽聽聽聽聽聽聽 echo -n "Starting oracle10g: "
聽聽聽聽聽聽聽 su - $ORA_USER -c "$ORA_HOME/bin/dbstart"
聽聽聽聽聽聽聽 su - $ORA_USER -c "$ORA_HOME/bin/lsnrctl start"
聽聽聽聽聽聽聽 touch /var/lock/subsys/oracle10g
聽聽聽聽聽聽聽 echo -n "--------------"
聽聽聽聽聽聽聽 ;;
聽聽聽 'stop')
聽聽聽聽聽聽聽 echo -n "Shutting down oracle10g: "
聽聽聽聽聽聽聽 su - $ORA_USER -c "$ORA_HOME/bin/dbshut"
聽聽聽聽聽聽聽 su - $ORA_USER -c "$ORA_HOME/bin/lsnrctl stop"
聽聽聽聽聽聽聽 rm -f /var/lock/subsys/oracle10g
聽聽聽聽聽聽聽 echo -n "--------------"
聽聽聽聽聽聽聽 ;;
聽聽聽 *)
聽聽聽聽聽聽聽 echo "Usage: oracle10g { start | stop }"
聽聽聽聽聽聽聽 exit 1 ;;
esac
exit 0
#!/bin/bash
#
# /etc/rc.d/init.d/tomcat
#
# Starts the tomcat daemon
#
# chkconfig: 345 99 99
# description: Runs commands scheduled by the at command at the time
# specified when at was run, and runs batch commands when the load
# average is low enough.
# processname: tomcat
#
# copyright: Written by Wwashington AT smth bbs, free to distribute.
# You must keep everything in this file, including the copyright
# announcement. Study demo: atd & postgresql in /etc/rc.d/init.d
# Source function library.
INITD=/etc/rc.d/init.d
. $INITD/functions
# Source system profile.
if [ -r /etc/profile ] ; then . /etc/profile ; fi
export JAVA_HOME=/www/server/jdk1.5.0_09/
export CATALINA_BASE=/www/server/apache-tomcat-5.5.20
export CATALINA_HOME=/www/server/apache-tomcat-5.5.20
export CATALINA_TMPDIR=/www/server/apache-tomcat-5.5.20/temp
case "$1" in
聽聽聽 'start')
聽聽聽聽聽聽聽 echo -n "Starting tomcat: "
聽聽聽聽聽聽聽 ${CATALINA_HOME}/bin/startup.sh
聽聽聽聽聽聽聽 touch /var/lock/subsys/tomcat
聽聽聽聽聽聽聽 echo聽 "--------------"
聽聽聽聽聽聽聽 ;;
聽聽聽 'stop')
聽聽聽聽聽聽聽 echo -n "Shutting down tomcat: "
聽聽聽聽聽聽聽 ${CATALINA_HOME}/bin/shutdown.sh
聽聽聽聽聽聽聽 rm -f /var/lock/subsys/tomcat
聽聽聽聽聽聽聽 echo "--------------"
聽聽聽聽聽聽聽 ;;
聽聽聽 *)
聽聽聽聽聽聽聽 echo "Usage: tomcat { start | stop | restart }"
聽聽聽聽聽聽聽 exit 1 ;;
esac
exit 0
#!/bin/bash
#
# /etc/rc.d/init.d/weblogic
#
# Starts the weblogic900 daemon
#
# chkconfig: 345 99 99
# description: Runs commands scheduled by the at command at the time
# specified when at was run, and runs batch commands when the load
# average is low enough.
# processname: weblogic
#
# copyright: Written by Wwashington AT smth bbs, free to distribute.
# You must keep everything in this file, including the copyright
# announcement. Study demo: atd & postgresql in /etc/rc.d/init.d
# Source function library.
INITD=/etc/rc.d/init.d
. $INITD/functions
# Source system profile.
if [ -r /etc/profile ] ; then . /etc/profile ; fi
case "$1" in
聽聽聽 'start')
聽聽聽聽聽聽聽 echo -n "Starting weblogic: "
聽#cd /www/server/bea/user_projects/domains/base_domain/bin/
聽聽聽聽聽聽聽 #/usr/bin/nohup ./startWebLogic.sh &
聽聽聽聽聽聽聽 #./startWebLogic.sh
聽/www/server/bea/user_projects/domains/base_domain/bin/startWebLogic.sh聽 &
聽touch /var/lock/subsys/weblogic
聽聽聽聽聽聽聽 echo聽 "--------------"
聽聽聽聽聽聽聽 ;;
聽聽聽 'stop')
聽聽聽聽聽聽聽 echo -n "Shutting down weblogic: "
聽聽聽聽聽聽聽 cd /www/server/bea/user_projects/domains/base_domain/bin/
聽聽聽聽聽聽聽 ./stopWebLogic.sh
聽聽聽聽聽聽聽 rm -f /var/lock/subsys/weblogic
聽聽聽聽聽聽聽 echo "--------------"
聽聽聽聽聽聽聽 ;;
聽聽聽 *)
聽聽聽聽聽聽聽 echo "Usage: weblogic { start | stop}"
聽聽聽聽聽聽聽 exit 1 ;;
esac
exit 0
#!/bin/sh
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind
# MySQL daemon start/stop script.
# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
# When this is done the mysql server will be started when the machine is
# started and shut down when the systems goes down.
# Comments to support chkconfig on RedHat Linux
# chkconfig: 345 85 85
# description: A very fast and reliable SQL database engine.
# Comments to support LSB init script conventions
### BEGIN INIT INFO
# Provides: mysql
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start:聽 3 5
# Default-Stop: 3 5
# Short-Description: start and stop MySQL
# Description: MySQL is a very fast and reliable SQL database engine.
### END INIT INFO
聽
# If you install MySQL on some other places than /www/server/mysql-3.23.58, then you
# have to do one of the following things for this script to work:
#
# - Run this script from within the MySQL installation directory
# - Create a /etc/my.cnf file with the following information:
#聽聽 [mysqld]
#聽聽 basedir=<path-to-mysql-installation-directory>
# - Add the above to any other configuration file (for example ~/.my.ini)
#聽聽 and copy my_print_defaults to /usr/bin
# - Add the path to the mysql-installation-directory to the basedir variable
#聽聽 below.
#
# If you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
basedir=
# The following variables are only set for letting mysql.server find things.
# Set some defaults
datadir=/www/var
pid_file=
if test -z "$basedir"
then
聽 basedir=/www/server/mysql-3.23.58
聽 bindir=/www/server/mysql-3.23.58/bin
else
聽 bindir="$basedir/bin"
fi
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin
export PATH
if test -z "$pid_file"
then
聽 pid_file=$datadir/`/bin/hostname`.pid
else
聽 case "$pid_file" in
聽聽聽 /* ) ;;
聽聽聽 * )聽 pid_file="$datadir/$pid_file" ;;
聽 esac
fi
mode=$1聽聽聽 # start or stop
parse_arguments() {
聽 for arg do
聽聽聽 case "$arg" in
聽聽聽聽聽 --basedir=*)聽 basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
聽聽聽聽聽 --datadir=*)聽 datadir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
聽聽聽聽聽 --pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
聽聽聽 esac
聽 done
}
# Get arguments from the my.cnf file,
# groups [mysqld] [mysql_server] and [mysql.server]
if test -x ./bin/my_print_defaults
then
聽 print_defaults="./bin/my_print_defaults"
elif test -x $bindir/my_print_defaults
then
聽 print_defaults="$bindir/my_print_defaults"
elif test -x $bindir/mysql_print_defaults
then
聽 print_defaults="$bindir/mysql_print_defaults"
else
聽 # Try to find basedir in /etc/my.cnf
聽 conf=/etc/my.cnf
聽 print_defaults=
聽 if test -r $conf
聽 then
聽聽聽 subpat='^[^=]*basedir[^=]*=\(.*\)$'
聽聽聽 dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
聽聽聽 for d in $dirs
聽聽聽 do
聽聽聽聽聽 d=`echo $d | sed -e 's/[ 聽]//g'`
聽聽聽聽聽 if test -x "$d/bin/my_print_defaults"
聽聽聽聽聽 then
聽聽聽聽聽聽聽 print_defaults="$d/bin/my_print_defaults"
聽聽聽聽聽聽聽 break
聽聽聽聽聽 fi
聽聽聽聽聽 if test -x "$d/bin/mysql_print_defaults"
聽聽聽聽聽 then
聽聽聽聽聽聽聽 print_defaults="$d/bin/mysql_print_defaults"
聽聽聽聽聽聽聽 break
聽聽聽聽聽 fi
聽聽聽 done
聽 fi
聽 # Hope it's in the PATH ... but I doubt it
聽 test -z "$print_defaults" && print_defaults="my_print_defaults"
fi
parse_arguments `$print_defaults mysqld mysql_server mysql.server`
# Safeguard (relative paths, core dumps..)
cd $basedir
case "$mode" in
聽 'start')
聽聽聽 # Start daemon
聽聽聽 if test -x $bindir/safe_mysqld
聽聽聽 then
聽聽聽聽聽 # Give extra arguments to mysqld with the my.cnf file. This script may
聽聽聽聽聽 # be overwritten at next upgrade.
聽聽聽聽聽 $bindir/safe_mysqld --datadir=$datadir --pid-file=$pid_file &
聽聽聽聽聽 # Make lock for RedHat / SuSE
聽聽聽聽聽 if test -w /var/lock/subsys
聽聽聽聽聽 then
聽聽聽聽聽聽聽 touch /var/lock/subsys/mysql
聽聽聽聽聽 fi
聽聽聽 else
聽聽聽聽聽 echo "Can't execute $bindir/safe_mysqld from dir $basedir"
聽聽聽 fi
聽聽聽 ;;
聽 'stop')
聽聽聽 # Stop daemon. We use a signal here to avoid having to know the
聽聽聽 # root password.
聽聽聽 if test -s "$pid_file"
聽聽聽 then
聽聽聽聽聽 mysqld_pid=`cat $pid_file`
聽聽聽聽聽 echo "Killing mysqld with pid $mysqld_pid"
聽聽聽聽聽 kill $mysqld_pid
聽聽聽聽聽 # mysqld should remove the pid_file when it exits, so wait for it.
聽聽聽聽聽 sleep 1
聽聽聽聽聽 while [ -s $pid_file -a "$flags" != aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ]
聽聽聽聽聽 do
聽聽聽聽聽聽聽 [ -z "$flags" ] && echo "Wait for mysqld to exit\c" || echo ".\c"
聽聽聽聽聽聽聽 flags=a$flags
聽聽聽聽聽聽聽 sleep 1
聽聽聽聽聽 done
聽聽聽聽聽 if [ -s $pid_file ]
聽聽聽聽聽聽聽聽 then echo " gave up waiting!"
聽聽聽聽聽 elif [ -n "$flags" ]
聽聽聽聽聽聽聽聽 then echo " done"
聽聽聽聽聽 fi
聽聽聽聽聽 # delete lock for RedHat / SuSE
聽聽聽聽聽 if test -f /var/lock/subsys/mysql
聽聽聽聽聽 then
聽聽聽聽聽聽聽 rm /var/lock/subsys/mysql
聽聽聽聽聽 fi
聽聽聽 else
聽聽聽聽聽 echo "No mysqld pid file found. Looked for $pid_file."
聽聽聽 fi
聽聽聽 ;;
聽 *)
聽聽聽 # usage
聽聽聽 echo "usage: $0 start|stop"
聽聽聽 exit 1
聽聽聽 ;;
esac
ProxyPassReverse聽 /app1 http://192.168.100.201:7001