001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.resource.adapter.quartz.inflow;
023:
024: import javax.resource.spi.ActivationSpec;
025: import javax.resource.spi.ResourceAdapter;
026: import javax.resource.spi.InvalidPropertyException;
027: import javax.resource.ResourceException;
028: import java.io.Serializable;
029:
030: /** The QuartzActivationSpec.
031: *
032: * @author bill@jboss.org
033: *
034: * @version $Revision: 57189 $
035: */
036: public class QuartzActivationSpec implements ActivationSpec,
037: Serializable {
038: /** The resource adapter */
039: private transient ResourceAdapter ra;
040:
041: private static long counter;
042:
043: private static synchronized long getCounter() {
044: return counter++;
045: }
046:
047: public QuartzActivationSpec() {
048:
049: }
050:
051: private String jobName = "job." + getCounter() + "."
052: + System.currentTimeMillis();
053: private String jobGroup = "default";
054: private String triggerName = "trigger." + getCounter() + "."
055: + System.currentTimeMillis();
056: private String triggerGroup = "default";
057: private String cronTrigger;
058: private boolean stateful;
059: private boolean volatility;
060: private boolean durable;
061: private boolean recoverable;
062:
063: //---- required ActivationSpec methods
064:
065: public boolean getDurable() {
066: return durable;
067: }
068:
069: public void setDurable(boolean durable) {
070: this .durable = durable;
071: }
072:
073: public boolean getRecoverable() {
074: return recoverable;
075: }
076:
077: public void setRecoverable(boolean recoverable) {
078: this .recoverable = recoverable;
079: }
080:
081: public void validate() throws InvalidPropertyException {
082: }
083:
084: public ResourceAdapter getResourceAdapter() {
085: return ra;
086: }
087:
088: public void setResourceAdapter(ResourceAdapter ra)
089: throws ResourceException {
090: this .ra = ra;
091: }
092:
093: //-- Java bean methods
094:
095: public boolean isStateful() {
096: return stateful;
097: }
098:
099: public void setStateful(boolean stateful) {
100: this .stateful = stateful;
101: }
102:
103: public String getJobName() {
104: return jobName;
105: }
106:
107: public void setJobName(String jobName) {
108: this .jobName = jobName;
109: }
110:
111: public String getJobGroup() {
112: return jobGroup;
113: }
114:
115: public void setJobGroup(String jobGroup) {
116: this .jobGroup = jobGroup;
117: }
118:
119: public String getTriggerName() {
120: return triggerName;
121: }
122:
123: public void setTriggerName(String triggerName) {
124: this .triggerName = triggerName;
125: }
126:
127: public String getTriggerGroup() {
128: return triggerGroup;
129: }
130:
131: public void setTriggerGroup(String triggerGroup) {
132: this .triggerGroup = triggerGroup;
133: }
134:
135: public String getCronTrigger() {
136: return cronTrigger;
137: }
138:
139: public void setCronTrigger(String cronTrigger) {
140: this .cronTrigger = cronTrigger;
141: }
142:
143: public String toString() {
144: return "jobName=" + jobName + ",jobGroup=" + jobGroup
145: + ",triggerName=" + triggerName + ",triggerGroup="
146: + triggerGroup + ",cronTrigger=" + cronTrigger
147: + "volatility" + volatility + "durability" + durable
148: + "recoverable" + recoverable;
149: }
150:
151: public boolean getVolatility() {
152: return volatility;
153: }
154:
155: public void setVolatility(boolean volatility) {
156: this.volatility = volatility;
157: }
158:
159: }
|