01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * 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.annotation.ejb;
23:
24: import java.lang.annotation.Annotation;
25: import java.io.Serializable;
26: import org.jboss.annotation.ejb.DeliveryMode;
27: import org.jboss.annotation.ejb.MessageProperties;
28:
29: /**
30: * comment
31: *
32: * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
33: */
34: public class MessagePropertiesImpl implements MessageProperties,
35: Serializable {
36: private static final long serialVersionUID = 4630480271844522009L;
37:
38: private DeliveryMode deliveryMode = DeliveryMode.PERSISTENT;
39: private int ttl = 0;
40: private int priority = 4;
41: private Class interfac;
42:
43: public MessagePropertiesImpl(DeliveryMode deliveryMode, int ttl,
44: int priority) {
45: this .deliveryMode = deliveryMode;
46: this .ttl = ttl;
47: this .priority = priority;
48: }
49:
50: public MessagePropertiesImpl(MessageProperties props) {
51: deliveryMode = props.delivery();
52: ttl = props.timeToLive();
53: priority = props.priority();
54: }
55:
56: public void setDelivery(DeliveryMode mode) {
57: this .deliveryMode = mode;
58: }
59:
60: public void setPriority(int priority) {
61: this .priority = priority;
62: }
63:
64: public MessagePropertiesImpl() {
65:
66: }
67:
68: public DeliveryMode delivery() {
69: return deliveryMode;
70: }
71:
72: public int timeToLive() {
73: return ttl;
74: }
75:
76: public int priority() {
77: return priority;
78: }
79:
80: public Class getInterface() {
81: return interfac;
82: }
83:
84: public void setInterface(Class interfac) {
85: this .interfac = interfac;
86: }
87:
88: public Class<? extends Annotation> annotationType() {
89: return MessageProperties.class;
90: }
91: }
|