Package java.util.logging

Examples of java.util.logging.ErrorManager


                            subscription.getNotificationListener(),
                            subscription.getNotificationFilter(), null );
                }
            }
        } catch( Exception e ) {
             new ErrorManager().error( "Error In " +
                  " MBeanServerRegistrationEventListener  ", e,
                  ErrorManager.GENERIC_FAILURE );
        }
    }
View Full Code Here


                    if ( ( methodName.startsWith( "set" ) )
                       && ( methodName.endsWith( propertyName ) ) )
                    {
                        Class[] parameterTypes = methods[j].getParameterTypes( );
                        if( parameterTypes.length != 1 ) {
                            new ErrorManager().error(
                                "Only one Parameter is allowed for the setter " +
                                " Method: " + methodName +
                                " has invalid signature", new Exception(),
                                ErrorManager.GENERIC_FAILURE );
                        }
                                                                                    
                        String parameterType = parameterTypes[0].getName();
                        Object[] parameters = new Object[1];
                                                                                    
                        if( parameterType.equals( "java.lang.String") ) {
                            parameters[0] = propertyValue;
                        } else if( parameterType.equals( "byte" ) ) {
                            parameters[0] =
                                new Byte( propertyValue.getBytes()[0]);
                        } else if( parameterType.equals( "int" ) ) {
                            parameters[0] = new Integer(propertyValue);
                        } else if( parameterType.equals( "float" ) ) {
                            parameters[0] = new Float(propertyValue);
                        } else if( parameterType.equals( "double") ) {
                            parameters[0] = new Double(propertyValue);
                        } else if( parameterType.equals( "char" ) ) {
                            parameters[0] =
                                new Character(propertyValue.charAt(0));
                        } else if( parameterType.equals("boolean") ) {
                            parameters[0] = new Boolean(propertyValue);
                        } else if( parameterType.equals("long") ) {
                            parameters[0] = new Long(propertyValue);
                        } else if( parameterType.equals("short") ) {
                             parameters[0] = new Short(propertyValue);
                        } else {
                            new ErrorManager().error(
                                "Only the basic primitive types can be set " +
                                "as properties to NotificationListener and " +
                                " NotificationFilter ", new Exception(),
                                ErrorManager.GENERIC_FAILURE );
                            continue;
                        }
                        methods[j].invoke( o,  parameters );
                    }
                }
            }
        } catch( Exception e ) {
            new ErrorManager().error(
                "Error While Setting properties to Notification Listener or " +
                " Filter ", e, ErrorManager.GENERIC_FAILURE );
        }
    }
View Full Code Here

                        }
                    }
                }           
            }
        } catch ( Exception e ) {
            new ErrorManager().error( "Error In Setting Initial Loglevel", e,
                ErrorManager.GENERIC_FAILURE );
        }       
        return null;
    }      
View Full Code Here

                // module log level change.
                LogMBean.getInstance().setLogLevelForModule(
                    event.getModuleName(), event.getNewLogLevel() );
            }
        } catch( Exception e ) {
            new ErrorManager().error( "Error In LogLevelChanged event", e,
                ErrorManager.GENERIC_FAILURE );
        }
    }
View Full Code Here

            // Now Try to register the LogMBean
            //new RegisterLogMBean( this ).start( );

        } catch( Exception e ) {
            new ErrorManager().error(
                "Error in LogMBean Initialization", e,
                ErrorManager.GENERIC_FAILURE );
        }
           
       return mBeanInfo;
View Full Code Here

                } else {
                    buf.append(obj.toString()).append(NVPAIR_SEPARATOR);
                }
            }
        } catch (Exception e) {
            new ErrorManager().error("Error in extracting Name Value Pairs", e,
                ErrorManager.FORMAT_FAILURE);
        }
    }
View Full Code Here

            recordBuffer.append(RECORD_END_MARKER);

            return recordBuffer.toString();
        } catch (Exception ex) {
            new ErrorManager().error("Error in formatting Logrecord", ex,
                ErrorManager.FORMAT_FAILURE);

            // We've already notified the exception, the following
            // return is to keep javac happy
            return new String("");
View Full Code Here

                openFile( fileName );
                // Change the file for LogViewer
                LogFilter.setLogFile( new LogFile( fileName ) );
                absoluteFileName = fileName;
            } catch( IOException ix ) {
                new ErrorManager().error(
                    "FATAL ERROR: COULD NOT OPEN LOG FILE. " +
                    "Please Check to make sure that the directory for " +
                    "Logfile exists. Currently reverting back to use the " +
                    " default server.log", ix, ErrorManager.OPEN_FAILURE );
                try {
                    // Reverting back to the old server.log
                    openFile( absoluteFileName );
                } catch( Exception e ) {
                    new ErrorManager().error(
                        "FATAL ERROR: COULD NOT RE-OPEN SERVER LOG FILE. ", e,
                        ErrorManager.OPEN_FAILURE );
                }
            }
        }
View Full Code Here

    synchronized void setLimitForRotation( int rotationLimitInBytes ) {
        if ((rotationLimitInBytes == 0) ||
          (rotationLimitInBytes >= MINIMUM_FILE_ROTATION_VALUE )) {
            limitForFileRotation = rotationLimitInBytes;
        }else{
            new ErrorManager().error(
                "WARNING: Log Rotation Size Limits > 0 KB and < 500 KB default to 500 KB.",
                null,ErrorManager.GENERIC_FAILURE );
            limitForFileRotation = MINIMUM_FILE_ROTATION_VALUE;
        }       
    }
View Full Code Here

                setFormatter( new UniformLogFormatter( ) );
            else {
                setFormatter( new CustomLogFormatter( ) );
            }
        } catch( Exception e ) {
            new ErrorManager().error(
                "FATAL ERROR: COULD NOT INSTANTIATE FILE AND SYSLOG HANDLER",
                e, ErrorManager.GENERIC_FAILURE );
        }
    }
View Full Code Here

TOP

Related Classes of java.util.logging.ErrorManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.