Question 115
You create a timer job.
You need to debug the timer job.
To which process should you attach the debugger?
A. devenv.exe
B. owstimer.exe
C. spucworkerprocess.exe
D. w3wp.exe

解析:
 这是关于调试的问题,参见Question56
在Sharepoint的开发环境中调试不同的对象有时需要Attach到不同的进程,下面就是一些常见的情况
   1、Farm Solution     -----W3WP.EXE
   2、SandBox Solution   -----PUCWorkerProcess.exe,( SharePoint 在一个独立于主 IIS 应用程序池 (w3wp.exe) 进程的进程 (SPUCWorkerProcess.exe) 中运行沙盒解决方案代码。所以你必须在SPUCWorkerProcess上进行调试)
   3、用到了Full-trust Proxy的SandBox Solution--SPUCWorkerProcessProxy.exe
   4、feature receivers----Feature Receiver默认情况下是自动被Visual Studio 启动。你可以在Visual Studio的部署设置中更改这种设置。
        4.1、feature receivers的 activation/deactivation :根据它被activation/deactivation 的方式,你需要Attaching到不同的进程。
             • 在web界面上启动或停止----W2WP.EXE
             • 在PowerShell中启动或停止---- PowerShell.exe
        4.2、feature receivers的 FeatureInstalled/FeatureUninstalling/FeatureUpgrading(安装/卸载/升级)----- owstimer.exe
 至于其它选项:
  选项A. devenv.exe是微软Microsoft Visual Studio的一部分,用于应用程序开发。存放在目录 C:\Windows\System32下, 这个进程在 Windows 启动时自动载入。
  选项B.C.D均可在上面找到对应描述。
所以本题目正确选项应该是B

参考:
http://msdn.microsoft.com/en-us/library/ff798310.aspx

Question 116
You need to create a timer job that queries a list.
What should you do?
A. Create a class that inherits SPJobDefinition and override the Execute method.
B. Create a class that inherits SPJobDefinition and override the Provision method.
C. Create a class that inherits SPServiceApplication and override the Provision method.
D. Create a class that inherits SPServiceApplication and override the ProvisionInstances method.

解析:
    本题考你如何创建一个Timer Job去查询一个列表。
  Microsoft SharePoint 2010 计时器作业执行维护您的 SharePoint 场所需的大部分后端作业。计时器作业是在计划的时间在一台或多台服务器上运行的可执行任务。可将计时器作业配置为正好运行一次,或按定期计划运行。
计时器作业类似于 Microsoft SQL Server 代理作业,这些代理作业可通过备份数据库、整理数据库文件碎片和更新数据库统计信息来维护 SQL Server 安装。SharePoint 使用计时器作业来维护长时间运行的工作流、清理旧的网站和日志以及监控服务器场以发现问题。 计时器作业有一些优势。它们可以定期并独立于正在访问您的 SharePoint 网站的用户运行,它们可以从您的 Web 前端服务器卸载长时间运行的进程,从而提高您页面的性能和响应能力,它们还可在比您的 SharePoint 网站和应用程序页中的代码更高的权限下运行代码。
   创建 SharePoint 计时器作业:包括随 SharePoint 安装的所有计时器作业均是通过 SPJobDefinition 类创建和执行的。要创建新的 SharePoint 计时器作业,首先必须向继承自 SPJobDefinition 类的项目添加一个类。
  以下代码段显示继承自 SPJobDefinition 类的一个类的示例。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint; namespace MonitoringJob {
public class MonitoringJob : SPJobDefinition {
public MonitoringJob() : base() { } public MonitoringJob(string jobName, SPService service)
: base(jobName, service, null, SPJobLockType.None) {
this.Title = jobName;
} public override void Execute(Guid targetInstanceId) {
// Put your job's code here.
}
}
}

在该代码段中,MonitoringJob 类继承自 SPJobDefinition 类,定义一个非默认构造函数,并重写基类的 Execute 方法。非默认构造函数是必需的,因为 SPJobDefinition 类的默认构造函数仅供内部使用。
创建构造函数后,您必须重写 SPJobDefinition 类的 Execute 方法,并用您的作业所需的代码替换该方法中的代码。如果您的代码可以在没有其他配置的情况下运行,则您已完成创建此类。否则,您必须向您的项目添加配置屏幕和类。
  至此,本题的答案就已经出来了:即选项A。
 进一步看其它选项:
选项B. Create a class that inherits SPJobDefinition and override the Provision method.: 重写SPJobDefinition 类的Porvision方法,此方法是用来修改本地服务器以使相关对象能够被使用。
选项C.D 均是继承自SPServiceApplication类,此类是一个抽象类,表示在服务器上运行的服务应用程序。
所以本题目正确选项应该是A
参考:
http://tomaszrabinski.pl/wordpress/2010/05/27/spjobdefinition-as-the-way-to-create-scheduled-tasks/
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spserviceapplication.aspx

Question 117
You need to schedule a timer job to run every two hours.
Which schedule should you use?
A. SPDailySchedule
B. SPHourlySchedule
C. SPMinuteSchedule
D. SPOneTimeSchedule

解析:
 本题要设置一个定时器工作每2个小时运行一次,那么你需要设置哪个计划类?
 当我们创建了TimerJob后,就需要把它部署到我们的Sharepoint场里去。通常推荐的做法 是创建一个Reature Receiver,然后利用FeatureActivated事件实例化你的Job,设置它的执行计划以及更新这个Job。
  下面就是一段Feature Receiver示例代码:

Class SyncListsFeatureReceiver:SPFeatureReceiver
{
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
try
{
SPWebApplication webApp = (SPWebApplication)properties.Feature.Parent;
//Good Practice to delete the older version of Job if it exists
foreach (SPJobDefinition job in webApp.JobDefinitions)
{
if (job.Name.ToLower() == myJobName.ToLower())
{
job.Delete();
}
}

//Install the job definition
 SyncListsJob tempJob = new SyncListsJob (myJobName,webApp);
 
 //如果你想每个小时运行一次作业,那么就使用SPHourlySchedule类

 //This one will run between 0 to 5 mintues of every hour
SPHourlySchedule schedule = new SPHourlySchedule();
schedule.BeginMinute = 0;
schedule.EndMinute = 5;
tempJob.Schedule = schedule;
tempJob.Update();
}
catch (Exception ex)
{
}
} public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
try
{
SPWebApplication webApp = (SPWebApplication)properties.Feature.Parent;
//delete the job
foreach (SPJobDefinition job in webApp.JobDefinitions)
{
if (job.Name.ToLower() == myJobName.ToLower()
{
job.Delete();
}
}
}
catch (Exception ex)
{
}
}
}

所以如何计划作业的运行就取决于我们在上代码中使用什么类,下面列举了可用的类:
1. SPOneTimeSchedule :如果你想在指定时间运行且仅运行一次作业,则使用此类。
2. SPMinuteSchedule 如果你想每隔多少分钟运行一次作业,那么就使用此类
3. SPHourlySchedule 如果你想每个小时运行作业,则使用此类
4. SPDailySchedule 如果你想每天的某个时间(如:11:05AM)准时运行一次作业,则使用此类
5. SPWeeklySchedule :如果你想每周的哪一天的指定时间运行作业(如:每周三的2:01:00 am to 2:01:05 am)那么就使用此类。
6. SPMonthlySchedule:如果你想每个月的某一天指定时间运行作业(每个月的1号在21:15am 到 1:30am之间运行),那么就使用此类
7. SPYearlySchedule:如果你想在每一年的某一天的指定时间运行作业(如:每年的1月18号9:05AM),则使用此类。
  本题是想每2个小时运行一次,所以只有用SPMinuteSchedule类,因为此类有间隔属性,可以用来设置每间隔多少时间运行作业。为什么不能用SPHourlySchedule类呢?因为很明显,SPHourlySchedule类只能每个小时都运行,它没有间隔属性,无法设置每间隔多少时间运行作业。
所以本题目正确选项应该是C

参考:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spminuteschedule_members.aspx

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.sphourlyschedule_members.aspx
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.sphourlyschedule.aspx
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.sponetimeschedule.aspx
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spdailyschedule.aspx
http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.spminuteschedule_members.aspx

Sharepoint学习笔记—习题系列--70-573习题解析 -(Q115-Q117)的更多相关文章

  1. Sharepoint学习笔记—ECM系列—文档列表的Metedata Navigation与Key Filter功能的实现

    如果一个文档列表中存放了成百上千的文档,想要快速的找到你想要的还真不是件容易的事,Sharepoint提供了Metedata Navigation与Key Filter功能可以帮助我们快速的过滤和定位 ...

  2. Sharepoint学习笔记—ECM系列--文档集(Document Set)的实现

    文档集是 SharePoint Server 2010 中的一项新功能,它使组织能够管理单个可交付文档或工作产品(可包含多个文档或文件).文档集是特殊类型的文件夹,它合并了唯一的文档集属性以及文件夹和 ...

  3. Sharepoint学习笔记—习题系列--70-576习题解析 --索引目录

        Sharepoint学习笔记—习题系列--70-576习题解析  为便于查阅,这里整理并列出了70-576习题解析系列的所有问题,有些内容可能会在以后更新. 需要事先申明的是:     1. ...

  4. Sharepoint学习笔记—习题系列--70-573习题解析 --索引目录

                  Sharepoint学习笔记—习题系列--70-573习题解析 为便于查阅,这里整理并列出了我前面播客中的关于70-573习题解析系列的所有问题,有些内容可能会在以后更新, ...

  5. Deep Learning(深度学习)学习笔记整理系列之(五)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  6. Deep Learning(深度学习)学习笔记整理系列之(八)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  7. Deep Learning(深度学习)学习笔记整理系列之(七)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  8. Deep Learning(深度学习)学习笔记整理系列之(六)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  9. Deep Learning(深度学习)学习笔记整理系列之(四)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  10. Deep Learning(深度学习)学习笔记整理系列之(三)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

随机推荐

  1. [原]编译Android源码过程中遇到的问题

    编译Android源码的过程参考Android官网介绍: 1.下载Android源码的步骤:https://source.android.com/source/downloading.html 2.编 ...

  2. 论文第4章:iOS绘图平台的实现

    面向移动设备的矢量绘图平台设计与实现 Design and Implementation of Mobile Device-oriented Vector Drawing Platform 引用本论文 ...

  3. oo智慧

    单一职责:学 寝室不能学习,学习要去教室 开闭原则:美 爱美穿衣打扮是扩展 整容是修改,修改有风险,所以对扩展开放,对修改封闭 里氏替换:死 人会死,你是人,你会死 依赖倒置:钱 一切向钱看,钱是抽象 ...

  4. AssetBundle系列——场景资源之打包(一)

    本篇讲解的是3D游戏的场景资源打包方式,首先简单的分析一下场景中所包含的资源的类型. 场景资源一般包含:地表模型(或者是Unity Terrain),非实例化物体(摄像机.空气墙.光源.各种逻辑物体之 ...

  5. DDD:《实现领域驱动》拾贝(待续)

    Design is not just what it looks like and feels like. Design is how it works.

  6. iOS- NSDateFormatter (自定义时间格式)

    一. NSDateFormatter解释 1. 日期(NSDate)是NSString类的格式(stringWithFormat),也可以改变输出,如果需要输出年代信息等则需要进行转换,等等. 2.  ...

  7. Android SQLite的ORM接口实现(一)---findAll和find的实现

    最近在看Android的ORM数据库框架LitePal,就想到可以利用原生的SQLite来实现和LitePal类似的ORM接口实现. LitePal有一个接口是这样的: List<Status& ...

  8. 华为手机Edittext光标(cursor)颜色修改

    华为手机的emui系统经常让人发出“可以可以,这很华为”的感叹 这两天在edittext部分也发生了这样的事情 正常edittext光标的颜色和宽度都说可以修改的,只需要通过xml中的 textCur ...

  9. ubuntu E: Could not get lock /var/lib/dpkg/lock - open

    sudo rm /var/lib/apt/lists/lock apt-get update

  10. C#中得到两个数百分比 (转)

    //此方法得到的百分比后小数太多,不行double percent=Convert.ToDouble(2)/Convert.ToDouble(34); string result=(percent*1 ...