KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > resource > adapter > quartz > inflow > QuartzActivationSpec


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.resource.adapter.quartz.inflow;
23
24 import javax.resource.spi.ActivationSpec JavaDoc;
25 import javax.resource.spi.ResourceAdapter JavaDoc;
26 import javax.resource.spi.InvalidPropertyException JavaDoc;
27 import javax.resource.ResourceException JavaDoc;
28 import java.io.Serializable JavaDoc;
29
30 /** The encapsulation of the mail folder endpoint specification
31  *
32  * @author Scott.Stark@jboss.org
33  * @version $Revision: 44029 $
34  */

35 public class QuartzActivationSpec
36    implements ActivationSpec JavaDoc, Serializable JavaDoc
37 {
38    /** The resource adapter */
39    private transient ResourceAdapter JavaDoc ra;
40
41    private static long counter;
42
43    private static synchronized long getCounter()
44    {
45       return counter++;
46    }
47
48    public QuartzActivationSpec()
49    {
50       
51    }
52
53    private String JavaDoc jobName = "job." + getCounter() + "." + System.currentTimeMillis();
54    private String JavaDoc jobGroup = "default";
55    private String JavaDoc triggerName = "trigger." + getCounter() + "." + System.currentTimeMillis();
56    private String JavaDoc triggerGroup = "default";
57    private String JavaDoc cronTrigger;
58    private boolean stateful;
59
60    //---- required ActivationSpec methods
61

62    public void validate() throws InvalidPropertyException JavaDoc
63    {
64    }
65
66    public ResourceAdapter JavaDoc getResourceAdapter()
67    {
68       return ra;
69    }
70
71    public void setResourceAdapter(ResourceAdapter JavaDoc ra) throws ResourceException JavaDoc
72    {
73       this.ra = ra;
74    }
75
76    //-- Java bean methods
77

78    public boolean isStateful()
79    {
80       return stateful;
81    }
82
83    public void setStateful(boolean stateful)
84    {
85       this.stateful = stateful;
86    }
87
88    public String JavaDoc getJobName()
89    {
90       return jobName;
91    }
92
93    public void setJobName(String JavaDoc jobName)
94    {
95       this.jobName = jobName;
96    }
97
98    public String JavaDoc getJobGroup()
99    {
100       return jobGroup;
101    }
102
103    public void setJobGroup(String JavaDoc jobGroup)
104    {
105       this.jobGroup = jobGroup;
106    }
107
108    public String JavaDoc getTriggerName()
109    {
110       return triggerName;
111    }
112
113    public void setTriggerName(String JavaDoc triggerName)
114    {
115       this.triggerName = triggerName;
116    }
117
118    public String JavaDoc getTriggerGroup()
119    {
120       return triggerGroup;
121    }
122
123    public void setTriggerGroup(String JavaDoc triggerGroup)
124    {
125       this.triggerGroup = triggerGroup;
126    }
127
128    public String JavaDoc getCronTrigger()
129    {
130       return cronTrigger;
131    }
132
133    public void setCronTrigger(String JavaDoc cronTrigger)
134    {
135       this.cronTrigger = cronTrigger;
136    }
137
138    public String JavaDoc toString()
139    {
140       return "jobName=" + jobName + ",jobGroup="+jobGroup+",triggerName="+triggerName+",triggerGroup="+triggerGroup+",cronTrigger="+cronTrigger;
141    }
142
143
144 }
145
Popular Tags