FileDocCategorySizeDatePackage
AppVerification.javaAPI DocGlassfish v2 API7230Fri May 04 22:34:22 BST 2007com.sun.enterprise.appverification.factory

AppVerification

public abstract class AppVerification extends Object
author
Qingqing Ouyang

Fields Summary
static Logger
_logger
private static boolean
instrument_on
private static boolean
redeploy
private static InstrumentLogger
instrumentLogger
private static com.sun.enterprise.util.LocalStringManagerImpl
localStrings
Constructors Summary
Methods Summary
public static booleandoInstrument()

        return instrument_on;
    
public static InstrumentLoggergetInstrumentLogger()

        if (instrumentLogger == null) {
            String name = null;
            Class cls = null;
            try {
                name = System.getProperty(
                        "j2ee.instrument.logger", 
                        "com.sun.enterprise.appverification.tools.InstrumentLoggerImpl");
                cls = Class.forName(name);
                if (cls != null) {
                    instrumentLogger = (InstrumentLogger)cls.newInstance();
                }
            } catch (ClassNotFoundException e) {
		            /** IASRI 4660742
                System.err.println(
                        localStrings.getLocalString(
                                "appverification.class.notfound",
                                "Class {0} not found",
                                new Object[] {name}));
		            **/
	              // START OF IASRI 4660742
		            _logger.log(Level.SEVERE,"appverification.class_notfound", new Object[] {name});
	              // END OF IASRI 4660742
            } catch (InstantiationException e) {
		            /** IASRI 4660742
                System.err.println(
                        localStrings.getLocalString(
                                "appverification.class.instantiate.error",
                                "Could not instantiate class {0}",
                                new Object[] {name}));
		            **/
	              // START OF IASRI 4660742
		            _logger.log(Level.SEVERE,"appverification.class_instantiate_error", new Object[] {name});
	              // END OF IASRI 4660742
            } catch (IllegalAccessException e) {
		            /** IASRI 4660742
                System.err.println(
                        localStrings.getLocalString(
                                "appverification.class.access.error",
                                "Could not access class {0}",
                                new Object[] {name}));
		            **/
	              // START OF IASRI 4660742
		             _logger.log(Level.SEVERE,"appverification.class_access_error", new Object[] {name});

	               // END OF IASRI 4660742
            }
        }
        return instrumentLogger;
    
public static booleanhasRedeployed()

        return redeploy;
    
public static voidredeploy(boolean hasRedeploy)

    
          
        redeploy = hasRedeploy;
    
public static voidsetInstrument(boolean on)

        if (on && getInstrumentLogger() == null) {
            instrument_on = false;
	         /** IASRI 4660742
            System.out.println(
                    localStrings.getLocalString(
                            "appverification.instrument.on.failed",
                            "J2EE instrumentation implementation class NOT defined."));
            System.out.println(
                    localStrings.getLocalString(
                            "appverification.instrument.off",
                            "J2EE Application Verification is OFF..."));
	         **/
	         // START OF IASRI 4660742
					if (_logger.isLoggable(Level.FINE)){
	         _logger.log(Level.FINE,localStrings.getLocalString(
                            "appverification.instrument.on.failed",
                            "J2EE instrumentation implementation class NOT defined."));
	         _logger.log(Level.FINE,localStrings.getLocalString(
                            "appverification.instrument.off",
                            "J2EE Application Verification is OFF..."));

					}
	         // END OF IASRI 4660742
        } else {
            instrument_on = on;
            if (instrument_on) {
		            /** IASRI 4660742
                System.out.println(
                        localStrings.getLocalString(
                                "appverification.instrument.on",
                                "J2EE Application Verification {0} is ON...",
                                new Object[] {instrumentLogger.getVersion()}));
		            **/
	              // START OF IASRI 4660742
					if (_logger.isLoggable(Level.FINE))
		            _logger.log(Level.FINE,localStrings.getLocalString(
                                "appverification.instrument.on",
                                "J2EE Application Verification {0} is ON...",
                                new Object[] {instrumentLogger.getVersion()}));
	              // END OF IASRI 4660742
            }
        }