KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > osgi > service > event > EventConstants


1 /*
2  * $Header: /cvshome/build/org.osgi.service.event/src/org/osgi/service/event/EventConstants.java,v 1.14 2006/07/12 21:06:18 hargrave Exp $
3  *
4  * Copyright (c) OSGi Alliance (2005, 2006). All Rights Reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.osgi.service.event;
20
21 import org.osgi.framework.Constants;
22
23 /**
24  *
25  * Defines standard names for <code>EventHandler</code> properties.
26  *
27  * @version $Revision: 1.14 $
28  */

29 public interface EventConstants {
30
31     /**
32      * Service registration property (named <code>event.topic</code>)
33      * specifying the <code>Event</code> topics of interest to a Event Handler
34      * service.
35      * <p>
36      * Event handlers SHOULD be registered with this property. The value of the
37      * property is an array of strings that describe the topics in which the
38      * handler is interested. An asterisk ('*') may be used as a trailing
39      * wildcard. Event Handlers which do not have a value for this property must
40      * not receive events. More precisely, the value of each entry in the array
41      * must conform to the following grammar:
42      *
43      * <pre>
44      * topic-description := '*' | topic ( '/*' )?
45      * topic := token ( '/' token )*
46      * </pre>
47      *
48      * @see Event
49      */

50     public static final String JavaDoc EVENT_TOPIC = "event.topics";
51
52     /**
53      * Service Registration property (named <code>event.filter</code>)
54      * specifying a filter to further select <code>Event</code> s of interest
55      * to a Event Handler service.
56      * <p>
57      * Event handlers MAY be registered with this property. The value of this
58      * property is a string containing an LDAP-style filter specification. Any
59      * of the event's properties may be used in the filter expression. Each
60      * event handler is notified for any event which belongs to the topics in
61      * which the handler has expressed an interest. If the event handler is also
62      * registered with this service property, then the properties of the event
63      * must also match the filter for the event to be delivered to the event
64      * handler.
65      * <p>
66      * If the filter syntax is invalid, then the Event Handler must be ignored
67      * and a warning should be logged.
68      *
69      * @see Event
70      * @see org.osgi.framework.Filter
71      */

72     public static final String JavaDoc EVENT_FILTER = "event.filter";
73
74     /**
75      * The Distinguished Name of the bundle relevant to the event.
76      */

77     public static final String JavaDoc BUNDLE_SIGNER = "bundle.signer";
78
79     /**
80      * The Bundle Symbolic Name of the bundle relevant to the event.
81      */

82     public static final String JavaDoc BUNDLE_SYMBOLICNAME = "bundle.symbolicName";
83
84     /**
85      * The Bundle id of the bundle relevant to the event.
86      *
87      * @since 1.1
88      */

89     public static final String JavaDoc BUNDLE_ID = "bundle.id";
90
91     /**
92      * The Bundle object of the bundle relevant to the event.
93      *
94      * @since 1.1
95      */

96     public static final String JavaDoc BUNDLE = "bundle";
97
98     /**
99      * The actual event object. Used when rebroadcasting an event that was sent
100      * via some other event mechanism.
101      */

102     public static final String JavaDoc EVENT = "event";
103
104     /**
105      * An exception or error.
106      */

107     public static final String JavaDoc EXCEPTION = "exception";
108
109     /**
110      * Must be equal to the name of the Exception class.
111      *
112      * @since 1.1
113      */

114     public static final String JavaDoc EXCEPTION_CLASS = "exception.class";
115
116     /**
117      * Must be equal to exception.getMessage()
118      */

119     public static final String JavaDoc EXCEPTION_MESSAGE = "exception.message";
120
121     /**
122      * A human-readable message that is usually not localized.
123      */

124     public static final String JavaDoc MESSAGE = "message";
125
126     /**
127      * A service
128      */

129
130     public static final String JavaDoc SERVICE = "service";
131
132     /**
133      * A service's id.
134      */

135     public static final String JavaDoc SERVICE_ID = Constants.SERVICE_ID;
136
137     /**
138      *
139      * A service's objectClass
140      */

141     public static final String JavaDoc SERVICE_OBJECTCLASS = "service.objectClass";
142
143     /**
144      *
145      * A service's persistent identity.
146      */

147     public static final String JavaDoc SERVICE_PID = Constants.SERVICE_PID;
148
149     /**
150      *
151      * The time when the event occurred, as reported by
152      * System.currentTimeMillis()
153      */

154     public static final String JavaDoc TIMESTAMP = "timestamp";
155
156     /**
157      * This constant was released with an incorrect spelling. It has been
158      * replaced by {@link #EXCEPTION_CLASS}
159      *
160      * @deprecated As of 1.1, replaced by EXCEPTION_CLASS
161      */

162     public static final String JavaDoc EXECPTION_CLASS = "exception.class";
163 }
Popular Tags