Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

abeans::pluggable::acs::logging::RemoteLoggingService Class Reference

Collaboration diagram for abeans::pluggable::acs::logging::RemoteLoggingService:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RemoteLoggingService ()
ComponentDescriptor getComponentDescriptor ()
void initialize (ComponentManager manager, Object state, ComponentDescriptor cdesc) throws IllegalComponentStateException, ComponentInitializationException
String[][] getConfigurationDescriptions ()
String getConfigurationName ()
void setConfiguration (AbeansProperties props) throws InitializationException
void run ()
void log (int priority, String log)
void flush ()
void destroy ()
void setRemoteDirectory (RemoteDirectory directory)
void setCORBARemoteDirectory (NamingContext nc)

Protected Attributes

CORBAService corbaService = null

Private Member Functions

void connectLogger (boolean allowLogging) throws ComponentInitializationException
void reconnectLogger ()
int extractIntProperty (AbeansProperties props, String name, int defaultValue)
void initializeCache ()
synchronized void cacheCheck (boolean forceSend)
synchronized void cache (Any log)
synchronized void cache (Any[] logs)
void pushLog (Any log)
void invalidateLogger (boolean force)
void sendLogs (Any[] logs)

Private Attributes

String loggerContextName = DEFAULT_CENTRALIZED_LOGGER
int minCachePriority = DEFAULT_MIN_CACHE_PRIORITY
int maxCachePriority = DEFAULT_MAX_CACHE_PRIORITY
int cacheSize = DEFAULT_CACHE_SIZE
int maxCacheSize = DEFAULT_MAX_CACHE_SIZE
int maxThreads = DEFAULT_MAX_THREADS
AbeansProperties serviceConfig = null
final transient ComponentDescriptor descriptor
ArrayList cache = null
boolean cacheEnabled = false
ThreadPoolService threadPool = null
ORB orb = null
boolean destroyPhase = false
int pending = 0
int threads = 0
boolean disableRemoteDirectoryLookup = false
RemoteDirectory remoteDirectory = null
NamingContext corbaRemoteDirectory = null
Log logger = null

Static Private Attributes

final String RLS_RESOURCE_LOC = "RemoteLoggingService"
final String CENTRALIZED_LOGGER = "CentralizedLogger"
final String MIN_CACHE_PRIORITY = "MinCachePriority"
final String MAX_CACHE_PRIORITY = "MaxCachePriority"
final String CACHE_SIZE = "CacheSize"
final String MAX_CACHE_SIZE = "MaxCacheSize"
final String MAX_THREADS = "MaxThreads"
final String DEFAULT_CENTRALIZED_LOGGER = "Log"
final String DISABLE_REMOTE_DIRECTORY = "DisableRemoteDirectoryLookup"
final int DEFAULT_MIN_CACHE_PRIORITY = 0
final int DEFAULT_MAX_CACHE_PRIORITY = 31
final int DEFAULT_CACHE_SIZE = 10
final int DEFAULT_MAX_CACHE_SIZE = 500
final int DEFAULT_MAX_THREADS = 10

Detailed Description

This service implements ACS Remote Logging Service. It caches logs and sends them to the centralized logger.

It depends on:

This implementation best effort is to minimize bad/broken connection impact to application execution performance (it should not block at all).

Author:
Matej Sekoranja (matej.sekoranja@cosylab.com)
Version:
@VERSION@


Constructor & Destructor Documentation

abeans::pluggable::acs::logging::RemoteLoggingService::RemoteLoggingService  )  [inline]
 

Constructor for RemoteLoggingService.


Member Function Documentation

synchronized void abeans::pluggable::acs::logging::RemoteLoggingService::cache Any[]  logs  )  [inline, private]
 

Stores logs into cache. If cache is disabled, logs will be lost.

Parameters:
log log message

synchronized void abeans::pluggable::acs::logging::RemoteLoggingService::cache Any  log  )  [inline, private]
 

Stores log into cache. If cache is disabled, log will be lost.

Parameters:
log log message

synchronized void abeans::pluggable::acs::logging::RemoteLoggingService::cacheCheck boolean  forceSend  )  [inline, private]
 

Checks if cache has reached its full capacity and sends the logs if necessary.

Parameters:
forceSend forces lofs to be sent

void abeans::pluggable::acs::logging::RemoteLoggingService::connectLogger boolean  allowLogging  )  throws ComponentInitializationException [inline, private]
 

Sync. method which connects to the CL

Exceptions:
ComponentInitializationException 

void abeans::pluggable::acs::logging::RemoteLoggingService::destroy  )  [inline]
 

Overloads the destroy to first perform a clean flush.

int abeans::pluggable::acs::logging::RemoteLoggingService::extractIntProperty AbeansProperties  props,
String  name,
int  defaultValue
[inline, private]
 

Extracts Method extractIntProperty.

Parameters:
name 
defaultValue 
Returns:
int

void abeans::pluggable::acs::logging::RemoteLoggingService::flush  )  [inline]
 

Flushes all logs from cache.

See also:
java.util.logging.Handler#flush()

ComponentDescriptor abeans::pluggable::acs::logging::RemoteLoggingService::getComponentDescriptor  )  [inline]
 

See also:
abeans.core.Component#getComponentDescriptor()

String [][] abeans::pluggable::acs::logging::RemoteLoggingService::getConfigurationDescriptions  )  [inline]
 

Returns the descriptors for this service.

Returns:
an array of configuration descriptions
See also:
abeans.core.defaults.Configurable#getConfigurationDescriptions()

String abeans::pluggable::acs::logging::RemoteLoggingService::getConfigurationName  )  [inline]
 

Returns name of the plug, the configuration name of this plug.

Returns:
configuration name
See also:
abeans.core.defaults.Configurable#getConfigurationName()

void abeans::pluggable::acs::logging::RemoteLoggingService::initialize ComponentManager  manager,
Object  state,
ComponentDescriptor  cdesc
throws IllegalComponentStateException, ComponentInitializationException [inline]
 

Initializes the component by placing it into the hierarchy.

Parameters:
manager the parent of this component, non-null
state must be null
cdesc must be null
Exceptions:
IllegalComponentStateException when the cdesc is not null
ComponentInitializationException when the manager already contains an authentication service instance
See also:
abeans.core.Component#initialize(ComponentManager, Object, ComponentDescriptor)

void abeans::pluggable::acs::logging::RemoteLoggingService::initializeCache  )  [inline, private]
 

Initialize cache buffer.

void abeans::pluggable::acs::logging::RemoteLoggingService::invalidateLogger boolean  force  )  [inline, private]
 

Connect task

void abeans::pluggable::acs::logging::RemoteLoggingService::log int  priority,
String  log
[inline]
 

Log entry method.

Parameters:
priority priority of log message
log log message
See also:
java.util.logging.Handler#publish(LogRecord)

void abeans::pluggable::acs::logging::RemoteLoggingService::pushLog Any  log  )  [inline, private]
 

Sends log to the centralized logger. If it fails, the log will be put back into cache.

Parameters:
log log message

void abeans::pluggable::acs::logging::RemoteLoggingService::reconnectLogger  )  [inline, private]
 

Silently tries to connect to the logger.

void abeans::pluggable::acs::logging::RemoteLoggingService::run  )  [inline]
 

Method run.

void abeans::pluggable::acs::logging::RemoteLoggingService::sendLogs Any[]  logs  )  [inline, private]
 

This is the method which actually sends the logs to the centralized logger (should be called in separate thread). If it fails, logs will be put back into cache.

Parameters:
logs log messages

void abeans::pluggable::acs::logging::RemoteLoggingService::setConfiguration AbeansProperties  props  )  throws InitializationException [inline]
 

Interprets the configuration delivered by Abeans configuration service.

Parameters:
prop the configuration, if null, the method returns NOP
Exceptions:
InitializationException when the configuration cannot be interpreted
See also:
abeans.core.defaults.Configurable#setConfiguration(AbeansProperties)

void abeans::pluggable::acs::logging::RemoteLoggingService::setCORBARemoteDirectory NamingContext  nc  )  [inline]
 

Set remote directory used to lookup for centralized logger reference.

Parameters:
directory remote directory.

void abeans::pluggable::acs::logging::RemoteLoggingService::setRemoteDirectory RemoteDirectory  directory  )  [inline]
 

Set remote directory used to lookup for centralized logger reference.

Parameters:
directory remote directory.


Member Data Documentation

ArrayList abeans::pluggable::acs::logging::RemoteLoggingService::cache = null [private]
 

Cache. Note that java.util.ArrayList is not synchornized.

final String abeans::pluggable::acs::logging::RemoteLoggingService::CACHE_SIZE = "CacheSize" [static, private]
 

The constant denoting the value of the configuration key. The number of log entries that can be kept in the local cache. When this number is reached, all log entries are transferred to the centralized logging. If network connection is not available, the local cache continues to grow, and every submitting of a log entry will attempt to flush the cache to the centralized logging.

boolean abeans::pluggable::acs::logging::RemoteLoggingService::cacheEnabled = false [private]
 

Caching policy.

int abeans::pluggable::acs::logging::RemoteLoggingService::cacheSize = DEFAULT_CACHE_SIZE [private]
 

The constant denoting the value of the configuration key. The number of log entries that can be kept in the local cache. When this number is reached, all log entries are transferred to the centralized logging. If network connection is not available, the local cache continues to grow, and every submitting of a log entry will attempt to flush the cache to the centralized logging.

final String abeans::pluggable::acs::logging::RemoteLoggingService::CENTRALIZED_LOGGER = "CentralizedLogger" [static, private]
 

The constant denoting the value of the configuration key. A stringified IOR of the centralized logging object. The IOR is expected to denote a persistent object which implements the Telecom Log Service�s Log interface, in particular the write_records method

NamingContext abeans::pluggable::acs::logging::RemoteLoggingService::corbaRemoteDirectory = null [private]
 

CORBA Remote Directory Service (used to lookup for cenralized logger reference). Additional RD, if remoteDirectory is not present.

CORBAService abeans::pluggable::acs::logging::RemoteLoggingService::corbaService = null [protected]
 

CORBA service component;

final int abeans::pluggable::acs::logging::RemoteLoggingService::DEFAULT_CACHE_SIZE = 10 [static, private]
 

The constant denoting the default cache size.

final String abeans::pluggable::acs::logging::RemoteLoggingService::DEFAULT_CENTRALIZED_LOGGER = "Log" [static, private]
 

The constant denoting the default Centralized Logger reference.

final int abeans::pluggable::acs::logging::RemoteLoggingService::DEFAULT_MAX_CACHE_PRIORITY = 31 [static, private]
 

The constant denoting the default max. cache priority.

final int abeans::pluggable::acs::logging::RemoteLoggingService::DEFAULT_MAX_CACHE_SIZE = 500 [static, private]
 

The constant denoting the default max. cache size.

final int abeans::pluggable::acs::logging::RemoteLoggingService::DEFAULT_MAX_THREADS = 10 [static, private]
 

The constant denoting the default max. number of threads.

final int abeans::pluggable::acs::logging::RemoteLoggingService::DEFAULT_MIN_CACHE_PRIORITY = 0 [static, private]
 

The constant denoting the default min. cache priority.

final transient ComponentDescriptor abeans::pluggable::acs::logging::RemoteLoggingService::descriptor [private]
 

Initial value:

new ComponentDescriptor(getClass(), RemoteLoggingService.class, 1, "ACS Remote Logging Service", false, true, null)
Component description of this plug.

boolean abeans::pluggable::acs::logging::RemoteLoggingService::destroyPhase = false [private]
 

Destroy phase status.

final String abeans::pluggable::acs::logging::RemoteLoggingService::DISABLE_REMOTE_DIRECTORY = "DisableRemoteDirectoryLookup" [static, private]
 

The constant denoting the value of the configuration key. Switch to disable remote directory lookup, reference should be provided manually via setRemoteDirectory method.

boolean abeans::pluggable::acs::logging::RemoteLoggingService::disableRemoteDirectoryLookup = false [private]
 

Switch to disable remote directory lookups.

Log abeans::pluggable::acs::logging::RemoteLoggingService::logger = null [private]
 

Centralized Logger remote object reference.

String abeans::pluggable::acs::logging::RemoteLoggingService::loggerContextName = DEFAULT_CENTRALIZED_LOGGER [private]
 

Context name of the Centralized Logger.

final String abeans::pluggable::acs::logging::RemoteLoggingService::MAX_CACHE_PRIORITY = "MaxCachePriority" [static, private]
 

The constant denoting the value of the configuration key. Log entries whose priority exceeds (is greater than) the one specified with this property will be directly transmitted to the centralized logging, bypassing the local cache. If this is less than MinCachePriority, the local cache feature is disabled.

final String abeans::pluggable::acs::logging::RemoteLoggingService::MAX_CACHE_SIZE = "MaxCacheSize" [static, private]
 

The constant denoting the value of the configuration key. The maximum number of log entries (also used for internal purposes) that can be kept in the local cache. When this number is reached, all log entries are lost (implementation to save them to file can be added).

final String abeans::pluggable::acs::logging::RemoteLoggingService::MAX_THREADS = "MaxThreads" [static, private]
 

The constant denoting the value of the configuration key. The maximum number of threads taken from thread pool by this service. NOTE: this value should be less than number of threads in the thread pool.

int abeans::pluggable::acs::logging::RemoteLoggingService::maxCachePriority = DEFAULT_MAX_CACHE_PRIORITY [private]
 

The constant denoting the value of the configuration key. Log entries whose priority exceeds (is greater than) the one specified with this property will be directly transmitted to the centralized logging, bypassing the local cache. If this is less than MinCachePriority, the local cache feature is disabled.

int abeans::pluggable::acs::logging::RemoteLoggingService::maxCacheSize = DEFAULT_MAX_CACHE_SIZE [private]
 

The maximum number of log entries (also used for internal purposes) that can be kept in the local cache. When this number is reached, all log entries are lost (implementation to save them to file can be added).

int abeans::pluggable::acs::logging::RemoteLoggingService::maxThreads = DEFAULT_MAX_THREADS [private]
 

The maximum number of threads taken from thread pool by this service.

final String abeans::pluggable::acs::logging::RemoteLoggingService::MIN_CACHE_PRIORITY = "MinCachePriority" [static, private]
 

The constant denoting the value of the configuration key. Log entries whose priority is below (smaller than) the one specified with this property will be ignored (neither cached nor submitted to the centralized logging). In release version of the system, this will be set to LM_INFO (3), ignoring LM_TRACE and LM_DEBUG log entries. Debug version of the system will set this to LM_DEBUG (2). During development, it will be set to LM_TRACE (1).

int abeans::pluggable::acs::logging::RemoteLoggingService::minCachePriority = DEFAULT_MIN_CACHE_PRIORITY [private]
 

The constant denoting the value of the configuration key. Log entries whose priority is below (smaller than) the one specified with this property will be ignored (neither cached nor submitted to the centralized logging). In release version of the system, this will be set to LM_INFO (3), ignoring LM_TRACE and LM_DEBUG log entries. Debug version of the system will set this to LM_DEBUG (2). During development, it will be set to LM_TRACE (1).

ORB abeans::pluggable::acs::logging::RemoteLoggingService::orb = null [private]
 

CORBA ORB.

int abeans::pluggable::acs::logging::RemoteLoggingService::pending = 0 [private]
 

Number of pending log messages to be sent.

RemoteDirectory abeans::pluggable::acs::logging::RemoteLoggingService::remoteDirectory = null [private]
 

Remote Directory Service (used to lookup for cenralized logger reference).

final String abeans::pluggable::acs::logging::RemoteLoggingService::RLS_RESOURCE_LOC = "RemoteLoggingService" [static, private]
 

The constant denoting the name of the configuration resource (file).

AbeansProperties abeans::pluggable::acs::logging::RemoteLoggingService::serviceConfig = null [private]
 

Properties of the service.

ThreadPoolService abeans::pluggable::acs::logging::RemoteLoggingService::threadPool = null [private]
 

Thread Pool Service.

int abeans::pluggable::acs::logging::RemoteLoggingService::threads = 0 [private]
 

Number of threads used.


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:43:28 2009 for ACS Java API by doxygen 1.3.8