Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: s IT Solutions AT Spardat GmbH - initial API and implementation /
 
 
 package at.spardat.xma.boot.exc;
 
Defines error constants and a method to get a localized text for some of them.

Author(s):
CGS
Version:
$Id: BRTCodes.java 2647 2008-08-26 13:53:08Z webok $
 
 public class BRTCodes {

    
Resource IDs for general messages
 
     public static final String      APPLICATION_ERROR_TITLE =   "APPLICATION_ERROR_TITLE";
     public static final String      ERROR_REASON            =   "ERROR_REASON";
     public static final String      LOGHINT                 =   "LOGHINT";
 
     // module constant
     public static final int         MODULE = 1002000;

    
RemoteCall, the server could not be contacted same ID as boot runtime, but other module
 
     public static final int         APPLICATION_ERROR =           + 1;


    
RemoteCall, the server could not be contacted same ID as boot runtime, but other module
 
     public static final int         SERVER_UNREACHABLE =          + 3;

    
RemoteCall, the server has been contacted but returned an unknown error same ID as boot runtime, but other module
 
     public static final int         SERVER_ERROR =                + 4;

    
Some Execption was thrown in the client or server side login procedure. same ID as boot runtime, but other module
 
     public static final int         LOGIN_TECHNICAL_ERROR =       + 201;

    
Serverevent is not allowed for the user same ID as boot runtime, but other module
 
     public static final int         PERMISSION_DENIED =           + 202;

    
The application version differs between client and server and the boot runtime was not able to update the application
 
     public static final int         VERSION_UPDATE_ERROR       =  + 501;


    
component not found in application
 
     public static final int         INVALID_CALL_XMA_URI       =  + 601;

    
component not found in application
 
     public static final int         COMPONENT_NOT_FOUND        =  + 602;

    
component is not accepted as its host is either not in 'boot.transport.hostname.accept' or in 'boot.transport.hostname.block'.
 
     public static final int         COMPONENT_NOT_ACCEPTED      =  + 603;


    
Returns true if a provided BaseException code originates from this module, i.e., is defined above.
 
     public boolean isXMAExceptionCode (int code) {
         return code - (code%1000) == ;
     }
 
 
    private static final String BUNDLE_NAME = "at.spardat.xma.boot.exc.Texts"//$NON-NLS-1$
    private static final ResourceBundle RESOURCE_BUNDLE =
        ResourceBundle.getBundle();

    
Returns the localized text for a particular code. The resource bundle is expected to provide an entry for a key that equals the code minus the MODULE constant.

Parameters:
code a code defined by one of the constants above
Returns:
a localized String never null
    public static String getText (int code) {
        String          key = "";
        key = String.valueOf (code - );
        return getTextkey );
    }
    public static String getTextString key ) {
        try {
            return .getString (key);
        } catch (MissingResourceException e) {
            return '!' + key + '!';
        }
    }
New to GrepCode? Check out our FAQ X