|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.prosyst.util.ref.Log
public class Log
Log class is responsible for forwarding bundles's messages to the LogService or console output.
| Field Summary | |
|---|---|
boolean |
autoPrintOnConsole
Flag, pointing whether printing on console should be done if log service is not available |
protected org.osgi.framework.BundleContext |
bc
BundleContext to get LogService and service owner of Log object BundleId |
boolean |
debug
Deprecated. since osgilib verion 1.3.9 use set/get Debug |
boolean |
printOnConsole
Deprecated. since osgilib verion 1.3.9 use set/get PrintOnConsole |
protected static com.prosyst.util.security.SecurityUtil |
securityUtil
|
| Constructor Summary | |
|---|---|
Log(org.osgi.framework.BundleContext bc)
|
|
Log(org.osgi.framework.BundleContext bc,
boolean initDebug)
Constructs a log object, used for logging information in the LogService. |
|
Log(java.lang.String baseName,
boolean synch,
org.osgi.framework.BundleContext bc)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
addingService(org.osgi.framework.ServiceReference reference)
A service is being added to the ServiceTracker object. |
void |
close()
Releases the Log's resources: ungets LogService, removes the ServiceListener from the framework and nulls references. |
void |
debug(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch)
Logs debug messages. |
void |
debug(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch,
boolean measurement)
Logs debug messages. |
void |
debug(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch,
boolean measurement,
boolean display)
Logs debug messages. |
void |
debug(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch,
boolean measurement,
boolean display,
boolean logInFile)
Logs debug messages. |
void |
debug(java.lang.String str,
java.lang.Throwable ex)
Logs debug information if debug flag is true. |
java.lang.Object |
dispatchPrivileged(int type,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
|
void |
error(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch)
Logs error messages. |
void |
error(java.lang.String str,
java.lang.Throwable ex)
Logs error messages. |
void |
fault(int level,
int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch)
|
void |
fault(int level,
java.lang.String str,
java.lang.Throwable exc)
|
void |
finalize()
|
boolean |
getDebug()
Gets the flag, which enables logging debug messages. |
boolean |
getPrintOnConsole()
Gets the flag, which enables printing log messages on the console. |
void |
info(int moduleID,
int msgID,
java.lang.String msg,
boolean synch)
Logs info messages. |
void |
info(java.lang.String str)
Logs info messages. |
boolean |
isAutoPrintOnConsole()
Checks the auto print on console flag |
boolean |
isLogErrorLevel()
Returns whether printing on console should be done for errors (exceptions) and warnings |
void |
modifiedService(org.osgi.framework.ServiceReference reference,
java.lang.Object service)
A service tracked by the ServiceTracker object has been
modified. |
void |
removedService(org.osgi.framework.ServiceReference reference,
java.lang.Object service)
A service tracked by the ServiceTracker object has been
removed. |
static boolean |
security()
|
void |
setAutoPrintOnConsole(boolean autoPrintOnConsole)
Enables/disables auto printing on console. |
void |
setDebug(boolean value)
enable/disable loging of debug info |
void |
setMaps(com.prosyst.util.hash.HashIntObjNS map0,
com.prosyst.util.hash.HashIntObjNS starts0)
|
void |
setPrintOnConsole(boolean value)
enable/disable print on console |
void |
trace(byte[] bytes)
|
void |
trace(byte[] bytes,
int off,
int len)
|
void |
trigger(java.lang.String module)
Forces measurements for process, heap and flash memory. |
void |
warning(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch)
Logs warning messages. |
void |
warning(java.lang.String str,
java.lang.Throwable ex)
Logs warning messages. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public boolean printOnConsole
public boolean autoPrintOnConsole
public boolean debug
protected static final com.prosyst.util.security.SecurityUtil securityUtil
protected org.osgi.framework.BundleContext bc
| Constructor Detail |
|---|
public Log(org.osgi.framework.BundleContext bc)
public Log(org.osgi.framework.BundleContext bc,
boolean initDebug)
bc - BundleContext, necessary to get LogService, in case it is started.
public Log(java.lang.String baseName,
boolean synch,
org.osgi.framework.BundleContext bc)
| Method Detail |
|---|
public void error(java.lang.String str,
java.lang.Throwable ex)
printOnConsole is true, or
if the LogService is unavailable, log info is printed on console.
error in interface LogInterfacestr - Message description of the error.ex - Throwable object, containing the stack trace; may be null.
public void fault(int level,
java.lang.String str,
java.lang.Throwable exc)
public void error(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch)
printOnConsole is true, or
if the LogService is unavailable, log info is printed on console.
moduleID - msgID - msg - Message description of the error.t - Throwable object, containing the stack trace; may be null.synch - Weather tracer to work synchronious or not
public void fault(int level,
int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch)
public void warning(java.lang.String str,
java.lang.Throwable ex)
printOnConsole is true, or
if the LogService is unavailable, log info is printed on console.
warning in interface LogInterfacestr - Message description of the error.ex - Throwable object, containing the stack trace; may be null.
public void warning(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch)
printOnConsole is true, or
if the LogService is unavailable, log info is printed on console.
moduleID - msgID - msg - Message description of the error.t - Throwable object, containing the stack trace; may be null.synch - Weather tracer to work synchronious or notpublic void info(java.lang.String str)
printOnConsole is true, or
if the LogService is unavailable, message is printed on console.
info in interface LogInterfacestr - Message to be logged.
public void info(int moduleID,
int msgID,
java.lang.String msg,
boolean synch)
printOnConsole is true, or
if the LogService is unavailable, log info is printed on console.
moduleID - msgID - msg - Message description of the error.synch - Weather tracer to work synchronious or not
public void debug(java.lang.String str,
java.lang.Throwable ex)
debug flag is true.
If LogService is unaccessible or printOnConsole flag is true, log info
is printed on console.
debug in interface LogInterfacestr - Message description.ex - Throwable object, containing the stack trace; may be null.
public void debug(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch)
printOnConsole is true, or
if the LogService is unavailable, log info is printed on console.
moduleID - msgID - msg - Message description of the error.t - Throwable object, containing the stack trace; may be null.synch - Indicates whether tracer should log the message synchronously or not
public void debug(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch,
boolean measurement)
printOnConsole is true, or
if the LogService is unavailable, log info is printed on console.
moduleID - msgID - msg - Message description of the error.t - Throwable object, containing the stack trace; may be null.synch - Indicates whether tracer should log the message synchronously or notmeasurement - Indicates whether the message is a measurement or not
public void debug(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch,
boolean measurement,
boolean display)
printOnConsole is true, or
if the LogService is unavailable, log info is printed on console.
moduleID - msgID - msg - Message description of the error.t - Throwable object, containing the stack trace; may be null.synch - Indicates whether tracer should log the message synchronously or notmeasurement - Indicates whether the message is a measurement or notdisplay - Indicates whether the message should be displayed in native GUI
public void debug(int moduleID,
int msgID,
java.lang.String msg,
java.lang.Throwable t,
boolean synch,
boolean measurement,
boolean display,
boolean logInFile)
printOnConsole is true, or
if the LogService is unavailable, log info is printed on console.
moduleID - msgID - msg - Message description of the error.t - Throwable object, containing the stack trace; may be null.synch - Indicates whether tracer should log the message synchronously or notmeasurement - Indicates whether the message is a measurement or notdisplay - Indicates whether the message should be displayed in native GUIlogInFile - Indicates whether the message should be logged into the log file or not. Used for measurements' logs.public void trigger(java.lang.String module)
mbs.measurements.heapMemory is set to true
then heap memory measurements are performed.
If mbs.measurements.processMemory is set to true
then process memory measurements are performed.
If mbs.measurements.flashMemory is set to true
then flash memory measurements (i.e. storage size) are performed.
module - specifies the module, which forced the measurementpublic void close()
close in interface LogInterfacepublic void setPrintOnConsole(boolean value)
setPrintOnConsole in interface LogInterfacevalue - boolean if true enables print on console else disables itpublic void setDebug(boolean value)
setDebug in interface LogInterfacevalue - boolean if true enables loging of debug info else disables itpublic boolean getDebug()
getDebug in interface LogInterfacepublic boolean getPrintOnConsole()
getPrintOnConsole in interface LogInterfacepublic java.lang.Object addingService(org.osgi.framework.ServiceReference reference)
ServiceTrackerCustomizerServiceTracker object.
This method is called before a service which matched the search
parameters of the ServiceTracker object is added to it.
This method should return the service object to be tracked for this
ServiceReference object. The returned service object is
stored in the ServiceTracker object and is available from
the getService and getServices methods.
addingService in interface ServiceTrackerCustomizerreference - Reference to service being added to the
ServiceTracker object.
ServiceReference object or null if
the ServiceReference object should not be tracked.
public void modifiedService(org.osgi.framework.ServiceReference reference,
java.lang.Object service)
ServiceTrackerCustomizerServiceTracker object has been
modified.
This method is called when a service being tracked by the
ServiceTracker object has had it properties modified.
modifiedService in interface ServiceTrackerCustomizerreference - Reference to service that has been modified.service - The service object for the modified service.
public void removedService(org.osgi.framework.ServiceReference reference,
java.lang.Object service)
ServiceTrackerCustomizerServiceTracker object has been
removed.
This method is called after a service is no longer being tracked by the
ServiceTracker object.
removedService in interface ServiceTrackerCustomizerreference - Reference to service that has been removed.service - The service object for the removed service.
public void setMaps(com.prosyst.util.hash.HashIntObjNS map0,
com.prosyst.util.hash.HashIntObjNS starts0)
public static boolean security()
public void trace(byte[] bytes)
public void trace(byte[] bytes,
int off,
int len)
public void finalize()
finalize in class java.lang.Objectpublic boolean isAutoPrintOnConsole()
public void setAutoPrintOnConsole(boolean autoPrintOnConsole)
autoPrintOnConsole - if true enables auto print on console else disables it.public boolean isLogErrorLevel()
public java.lang.Object dispatchPrivileged(int type,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
throws java.lang.Exception
dispatchPrivileged in interface com.prosyst.util.security.PrivilegedRunner.PrivilegedDispatchertype - the type of the actionarg1 - parameter 1 - depends on the action typearg2 - parameter 2 - depends on the action typearg3 - parameter 3 - depends on the action typearg4 - parameter 4 - depends on the action type
java.lang.Exception - on errorPrivilegedRunner.PrivilegedDispatcher.dispatchPrivileged(int, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||