2012-02-03 13 views
1

私は@Scheduleアノテーションで作成されたTimerServiceを持っていますが、デプロイメント記述子のタグを使って分パラメータを上書きできるようにします。@Schedule注釈デプロイメント記述子タグ?

ウェブを検索しましたが、TimerServicesを参照するすべてのページで@Scheduleがアノテーションとして説明されています。

可能ですか?違いますか?事前ここ

答えて

2

おかげで@Scheduled注釈にejb-jar.xmlスニペットeqivalentです:

<?xml version="1.0" encoding="UTF-8"?> 
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"> 
    <enterprise-beans> 
     <session> 
      <ejb-name>DummyTimer4</ejb-name> 
      <ejb-class>org.glassfish.samples.DummyTimer4</ejb-class> 
      <session-type>Stateless</session-type> 
      <timer> 
       <schedule> 
        <second>*/10</second> 
        <minute>*</minute> 
        <hour>*</hour> 
        <month>*</month> 
        <year>*</year> 
       </schedule> 
       <timeout-method> 
        <method-name>timeout</method-name> 
        <method-params> 
         <method-param>javax.ejb.Timer</method-param> 
        </method-params> 
       </timeout-method> 
      </timer> 
     </session> 
    </enterprise-beans> 
</ejb-jar> 

も参照してください:https://blogs.oracle.com/arungupta/entry/totd_146_understanding_the_ejb

関連する問題