首页 \ 问答 \ Java JVM分析,线程状态 - “监视”状态是什么意思?(Java JVM profiling, thread status - what does “Monitor” status mean?)

Java JVM分析,线程状态 - “监视”状态是什么意思?(Java JVM profiling, thread status - what does “Monitor” status mean?)

在此输入图像描述

我使用visualVM连接多线程Java应用程序,线程有4个状态,即运行,睡眠,等待,监视。 监控状态是什么意思? 等待和监视器有什么区别?


enter image description here

I use visualVM connect a multi thread Java application, thread has 4 status, namely running, sleeping, wait, Monitor. What does this Monitoring status mean? What's the difference between wait and Monitor?


原文:https://stackoverflow.com/questions/6705400
更新时间:2022-03-05 14:03

最满意答案

要将事件接收器绑定到特定的内容类型,可以使用内容类型元素文件的XmlDocuments元素。 以下是我即将出版的书“建立SharePoint用户体验”的一个相当独特的摘录:

而且,为了澄清,因为我没有看到您尝试发布的XML,您可以将其添加到elements.xml文件中的内容类型声明中。

(......)

使用功能将事件接收器附加到内容类型

附加事件接收器的重要之处就像我们刚才看到的,注意到没有办法将接收器绑定到内容类型,只能绑定到列表模板。

不,没有办法将接收器添加到单个列表中。 但是,正如我们在列表森林中的电子邮件启用自定义列表部分中所看到的那样,我们可以使用代码以编程方式添加事件接收器。 我们可以使用相同的技术将事件接收器添加到内容类型中,但应该有一种方法可以在特征中使用CAML来完成此操作。 毕竟这是我们定义内容类型的地方,我们将在本章后面看到。

答案? 内容类型中的事件接收器在元素文件的不同部分中定义。 我们再次看看XmlDocuments和第三个内置的XmlDocument类型Receiver。 Receiver XmlDocument驻留在http://schemas.microsoft.com/sharepoint/events名称空间中。 如果要在默认SharePoint安装中查看Receiver XmlDocument,请在ctypeswss.xml文件中搜索内容类型为0x010107的DocumentWorkflowItem:

<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
 <spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
  <Receiver>
   <Name>Workflow Library Item Added</Name>
   <Type>ItemAdded</Type>
   <SequenceNumber>1</SequenceNumber>
   <Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,~CCC
    PublicKeyToken=71e9bce111e9429c</Assembly>
   <Class>Microsoft.SharePoint.Workflow.SPWorkflowLibraryEventReceiver</Class>
   <Data />
   <Filter />
  </Receiver>
… (snipped for space saving purposes
 </Receivers>
</XmlDocument>

注意该示例对Receivers元素使用前缀spe:。 从技术角度来看,这不是必需的,但可以增加您的代码的清晰度。 如您所见,Receiver元素遵循元素中定义的常规项目事件接收器的结构。 当然,除了接收者是在内容类型的XmlDocument部分定义的。


To bind an event receiver to a specific content type, you use the XmlDocuments element of the content type elements file. Here's a rather exclusive excerpt from my upcoming book "Building the SharePoint User Experience":

And, just to clarify, since I don't see the XML you tried to post, you would add this to the content type declaration in the elements.xml file.

(...)

Attaching event receivers to content types using features

The important thing with attaching event receivers like we just saw is to notice that there is no way to bind a receiver to a content type, only to a list template.

No, there are no ways to add receivers to individual lists either. However, as we saw in the Email enabling custom lists section in the Forest of lists chapter we can programmatically add event receivers using code. We can use the same technique to add event receivers to a content type as well, but there should be a way to do this using CAML in a feature. After all that is where we define the content type, as we will see later in the chapter.

The answer? Event receivers in content types are defined in a different section of the elements file. Again we look to XmlDocuments and the third built-in XmlDocument type Receiver. The Receiver XmlDocument resides in the http://schemas.microsoft.com/sharepoint/events namespace. If you want to see a Receiver XmlDocument in your default SharePoint installation, search the ctypeswss.xml file for the content type 0x010107, the DocumentWorkflowItem:

<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
 <spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
  <Receiver>
   <Name>Workflow Library Item Added</Name>
   <Type>ItemAdded</Type>
   <SequenceNumber>1</SequenceNumber>
   <Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,~CCC
    PublicKeyToken=71e9bce111e9429c</Assembly>
   <Class>Microsoft.SharePoint.Workflow.SPWorkflowLibraryEventReceiver</Class>
   <Data />
   <Filter />
  </Receiver>
… (snipped for space saving purposes
 </Receivers>
</XmlDocument>

Note The example uses a prefix spe: for the Receivers element. This is not necessary from a technical point of view, but can add clarity to your code. As you can see, the Receiver element follows the structure of a regular item event receiver as defined in elements. Except, of course, that the receiver is defined in the XmlDocument section of the content type.

相关问答

更多

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)