linux下su和su-以及sudo的介绍 ERIKXUE
2014-04-14 14:18
411 查看
spirng配置如下
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<!-- 要调用的工作类 ,已经使用注解管理bean-->
<bean id="logJob" class="com.liuli.job.LogJob" />
<!-- 线程执行器配置,用于任务注册 -->
<bean id="executor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="5"/> <!-- 线程池维护线程的最少数量 -->
<property name="maxPoolSize" value="10"/><!-- 线程池维护线程的最大数量 -->
<property name="queueCapacity" value="50"/><!-- 线程池所使用的缓冲队列 -->
</bean>
<bean id="jobtask_LogJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="group" value="job_work"/>
<property name="name" value="job_work_name"/>
<property name="concurrent" value="false"/> <!-- 默认为并发执行,FALSE可以控制并发执行 -->
<property name="targetObject" ref="logJob" /> <!-- 任务类 -->
<property name="targetMethod" value="createTable" /> <!-- 任务方法 -->
</bean>
<!-- 定义触发时间 -->
<bean id="cronTrigger_LogJob" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="jobtask_LogJob" />
<!-- cron表达式 --><!-- 每月的15号0时0分0秒 秒 分 时 天 月 星期 年-->
<property name="cronExpression" value="0 42 11 5 * ? *" />
</bean>
<!--设置调度 总管理类 如果将lazy-init='false'那么容器启动就会执行调度程序 -->
<bean id="startQuertz" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers"> <!-- 可以通过该属性注册多个Trigger -->
<list>
<ref bean="cronTrigger_LogJob" />
</list>
</property>
<property name="taskExecutor" ref="executor" />
</bean>
</beans>
-------Job类如下
public class LogJob {
public void createTable(){
System.out.println("222"+new java.util.Date());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<!-- 要调用的工作类 ,已经使用注解管理bean-->
<bean id="logJob" class="com.liuli.job.LogJob" />
<!-- 线程执行器配置,用于任务注册 -->
<bean id="executor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="5"/> <!-- 线程池维护线程的最少数量 -->
<property name="maxPoolSize" value="10"/><!-- 线程池维护线程的最大数量 -->
<property name="queueCapacity" value="50"/><!-- 线程池所使用的缓冲队列 -->
</bean>
<bean id="jobtask_LogJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="group" value="job_work"/>
<property name="name" value="job_work_name"/>
<property name="concurrent" value="false"/> <!-- 默认为并发执行,FALSE可以控制并发执行 -->
<property name="targetObject" ref="logJob" /> <!-- 任务类 -->
<property name="targetMethod" value="createTable" /> <!-- 任务方法 -->
</bean>
<!-- 定义触发时间 -->
<bean id="cronTrigger_LogJob" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="jobtask_LogJob" />
<!-- cron表达式 --><!-- 每月的15号0时0分0秒 秒 分 时 天 月 星期 年-->
<property name="cronExpression" value="0 42 11 5 * ? *" />
</bean>
<!--设置调度 总管理类 如果将lazy-init='false'那么容器启动就会执行调度程序 -->
<bean id="startQuertz" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers"> <!-- 可以通过该属性注册多个Trigger -->
<list>
<ref bean="cronTrigger_LogJob" />
</list>
</property>
<property name="taskExecutor" ref="executor" />
</bean>
</beans>
-------Job类如下
public class LogJob {
public void createTable(){
System.out.println("222"+new java.util.Date());
}
}
相关文章推荐
- linux下su和su-以及sudo的介绍
- Red Hat Linux 7.0 安装图解 薛忠权 ERIKXUE
- LINUX 常用杂文 ERIKXUE
- Linux login & non-login shell 以及su, sudo相关概念
- linux 查看当前用户id、whoami用户列表、用户组、用户权限/etc/passwd、/etc/group、/etc/shadow以及切换用户身份、su、sudo、/etc/sudoers
- [置顶] ibatis学习(一)--ibatis介绍以及用例
- linux查看当前用户id、whoami用户列表、用户组、用户权限/etc/passwd、/etc/group、/etc/shadow以及切换用户身份、su、sudo、/etc/sudoers
- 如何让Linux禁止Ctrl+Alt+Del重启(防止被强行关闭) erikxue 薛忠权
- linux su和sudo命令的区别及C…
- 简单介绍Linux下的重要命令--(du, df, top, free, pstack, su, sudo, adduser, password )
- Linux中su、sudo命令使用及区别介绍
- linux――源码编译安装httpd ERIKXUE薛忠权
- Linux下MySQL出现乱码的解决方法以及如何设置编码方式
- 使用BASH编写Linux Shell脚本——1. Linux 介绍
- linux 下 du, df, top, free, pstack, su, sudo(sudo -, sudo -s), adduser, password命令介绍
- 第三节 Linux用户管理常用命令
- linux su和sudo命令的区别
- linux的用户管理,sudo的介绍和开机修改root密码
- linux守护进程介绍以及如何编写守护进程
- linux 下su与sudo的理解