KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jass > hls > ont > ONTServiceManager


1 /**
2  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3  -
4  - JASS: Java Advanced tranSaction Support
5  -
6  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
7  -
8  - This module was originally developed by
9  -
10  - LSD (Distributed Systems Lab, http://lsd.ls.fi.upm.es/lsd/lsd.htm)
11  - at Universidad Politecnica de Madrid (UPM) as an ObjectWeb Consortium
12  - (http://www.objectweb.org) project.
13  -
14  - This project has been partially funded by the European Commission under
15  - the IST programme of V FP grant IST-2001-37126 and by the Spanish
16  - Ministry of Science & Technology (MCyT) grants TIC2002-10376-E and
17  - TIC2001-1586-C03-02
18  -
19  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
20  - The original code and portions created by LSD are
21  - Copyright (c) 2004 LSD (UPM)
22  - All rights reserved.
23  -
24  - Redistribution and use in source and binary forms, with or without
25  - modification, are permitted provided that the following conditions are met:
26  -
27  - -Redistributions of source code must retain the above copyright notice, this
28  - list of conditions and the following disclaimer.
29  -
30  - -Redistributions in binary form must reproduce the above copyright notice,
31  - this list of conditions and the following disclaimer in the documentation
32  - and/or other materials provided with the distribution.
33  -
34  - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
35  - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36  - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37  - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
38  - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
39  - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40  - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41  - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
42  - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
43  - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
44  - POSSIBILITY OF SUCH DAMAGE.
45  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
46  -
47  - Author: Francisco Perez Sorrosal (frperezs)
48  -
49  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
50 */

51
52 package org.objectweb.jass.hls.ont;
53
54 import javax.activity.coordination.ServiceManager;
55 import javax.activity.coordination.SignalSet;
56 import javax.activity.coordination.SubordinateSignalSet;
57 import javax.activity.coordination.RecoverableAction;
58 import javax.activity.*;
59 import javax.activity.propertygroup.PropertyGroupManager;
60 import java.io.Serializable JavaDoc;
61
62 /**
63  * Implements the ONT service manager. An object of this class will be
64  * registered on the Activity Service instance by the ONT service
65  * implementation.
66  * @author fran
67  * Date: Feb 12, 2004
68  * org.objectweb.jass.hls.ontONTServiceManager.java
69  */

70 public class ONTServiceManager implements ServiceManager {
71
72     public static String JavaDoc SERVICE_NAME = "javax.activity.opennested";
73
74     private ServiceInformation serviceInfo;
75
76     /**
77      * Constructor for the ONT service manager implementation. Sets the service
78      * information (only the service name).
79      */

80     public ONTServiceManager() {
81         serviceInfo =
82             new ServiceInformation(SERVICE_NAME, null, (Serializable JavaDoc) null);
83     }
84
85     // ServiceManager implementation ----------------------------
86

87     /**
88      * Retruns the ONT service information (it only has the service name).
89      */

90     public ServiceInformation getServiceInformation() {
91         return serviceInfo;
92     }
93
94     /**
95      * Returns an instance of the unique signal set for the ONT service. If the
96      * required signal set is not valid, it throws the
97      * SignalSetUnknownException.
98      */

99     public SignalSet getSignalSet(String JavaDoc signalSetName)
100         throws SignalSetUnknownException, NoImplementException {
101
102         if (!signalSetName.equals(ONTCompletionSS.COMPLETION_SS_NAME))
103             throw new SignalSetUnknownException();
104         // We always return the unique SignalSet
105
return new ONTCompletionSS();
106     }
107
108     /**
109      * Not necessary for ONT service.
110      */

111     public SubordinateSignalSet getSubordinateSignalSet(String JavaDoc signalSetName)
112         throws SignalSetUnknownException, NoImplementException {
113         return null;
114     }
115
116     /**
117      * Not necessary for ONT service.
118      */

119     public PropertyGroupManager getPropertyGroupManager(String JavaDoc propertyGroupName)
120         throws PropertyGroupUnknownException {
121         return null;
122     }
123
124     /**
125      * Not necessary for ONT service.
126      */

127     public String JavaDoc[] getPropertyGroupNames() {
128         return null;
129     }
130
131     /**
132      * Returns the name of the ONT completion signal set.
133      */

134     public String JavaDoc getCompletionSignalSetName() {
135         return ONTCompletionSS.COMPLETION_SS_NAME;
136     }
137
138     /**
139      * Not necessary for current ONT service implementation.
140      */

141     public int getActivityType() {
142         return 2;
143     }
144
145     /**
146      * Not yet implemented.
147      */

148     public void activityImported(ServiceInformation serviceInfo) {
149     }
150
151     /**
152      * Not yet implemented.
153      */

154
155     public SignalSet[] recoverSignalSets(GlobalId globalId)
156         throws ActivityCompletedException, SystemException {
157         return null;
158     }
159
160     /**
161      * Not yet implemented.
162      */

163     public RecoverableAction[] recoverActions(
164         GlobalId globalId,
165         String JavaDoc signalSetName)
166         throws SignalSetUnknownException, ActivityCompletedException, SystemException {
167         return new RecoverableAction[0];
168     }
169
170 }
171
Popular Tags