ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/componentmanager/ReferenceManager.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/componentmanager/ReferenceManager.java (file contents):
Revision 1.8 by ajm, Wed Dec 13 13:42:50 2000 UTC vs.
Revision 1.13 by tdb, Wed Mar 14 23:25:29 2001 UTC

# Line 1 | Line 1
1   //---PACKAGE DECLARATION---
2 < package uk.ac.ukc.iscream.util;
2 > package uk.org.iscream.componentmanager;
3  
4   //---IMPORTS---
5   import org.omg.CORBA.ORB;
6   import org.omg.CosNaming.*;
7   import org.omg.PortableServer.*;
8 < import uk.ac.ukc.iscream.core.*;
8 > import uk.org.iscream.core.*;
9 > import uk.org.iscream.util.*;
10  
11   /**
12   * This class returns references for global system objects.
# Line 80 | Line 81 | public class ReferenceManager {
81              dieWithError("\nCRITICAL:Invalid Name - when resolving reference to " + name + "!\n" +
82                                "         Please check with your CORBA naming service provider.");
83          } catch (org.omg.CosNaming.NamingContextPackage.NotFound e) {
84 <            dieWithError("\nCRITICAL:Not Found - when resolving reference to " + name + "!\n" +
84 >            recoverWithError("\nCRITICAL:Not Found - when resolving reference to " + name + "!\n" +
85                                "         Please check that this component is running.");
86          }
87          return objRef;
# Line 110 | Line 111 | public class ReferenceManager {
111              dieWithError("\nCRITICAL:Naming Service Cannot Proceed - when binding " + name + "!\n" +
112                                "         Please check with your CORBA naming service provider.");
113          } catch (org.omg.CosNaming.NamingContextPackage.NotFound e) {
114 <            dieWithError("\nCRITICAL:Naming Service Not Found - when binding " + name + "!\n" +
114 >            recoverWithError("\nCRITICAL:Naming Service Not Found - when binding " + name + "!\n" +
115                                "         Please check with your CORBA naming service provider.");
116          } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound e) {
117              dieWithError("\nCRITICAL:Already Bound - when binding " + name + "!\n" +
# Line 135 | Line 136 | public class ReferenceManager {
136       * Overrides the {@link java.lang.Object#toString() Object.toString()}
137       * method to provide clean logging (every class should have this).
138       *
139 <     * This uses the uk.ac.ukc.iscream.util.NameFormat class
139 >     * This uses the uk.org.iscream.util.NameFormat class
140       * to format the toString()
141       *
142       * @return the name of this class and its CVS revision
# Line 153 | Line 154 | public class ReferenceManager {
154       * If there are any CORBA errors this method is called with the
155       * error message.
156       *
157 +     * The exception this throws is generic to CORBA communication
158 +     * problems, this is a Runtime exception and is typically only
159 +     * explicitly caught in the ComponentManager for the current VM
160 +     * The ComponentManager can then decide what course of action to
161 +     * take.
162 +     *
163 +     * Also, if it can, it will log the message with the logger.
164 +     *
165 +     * @param message the error message to die with
166 +     */
167 +    private void recoverWithError(String message) throws ComponentCORBAException {
168 +        if (_logger != null) {
169 +            _logger.write(toString(), Logger.WARNING, "component CORBA error - " + message);
170 +        }
171 +        throw new ComponentCORBAException(message);
172 +    }
173 +
174 +
175 +    /**
176 +     * If there are any CORBA errors this method is called with the
177 +     * error message.
178 +     *
179       * Currently this prints the error, on the local err stream.  Will
180       * print to the logger if one is available.
181       *
# Line 169 | Line 192 | public class ReferenceManager {
192          }
193          System.exit(1);
194      }
195 +
196 +
197  
198   //---ACCESSOR/MUTATOR METHODS---
199  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines