Changeset 3743

Show
Ignore:
Timestamp:
05/08/07 17:37:41 (6 years ago)
Author:
balister
Message:

changes to fit JTAP

Location:
platform/logService
Files:
16 modified

Legend:

Unmodified
Added
Removed
  • platform/logService/CosLwLogAdministrator.idl

    r3615 r3743  
    88#endif 
    99 
    10 module CosLwLog { 
     10module LogService { 
    1111    interface LogAdministrator : LogStatus { 
    1212        void set_max_size(in unsigned long long size) 
  • platform/logService/CosLwLogConsumer.idl

    r3615 r3743  
    88#endif 
    99 
    10 module CosLwLog { 
     10module LogService { 
    1111    interface LogConsumer : LogStatus { 
    1212        RecordId get_record_id_from_time (in LogTime fromTime); 
  • platform/logService/CosLwLogProducer.idl

    r3615 r3743  
    88#endif 
    99 
    10 module CosLwLog { 
     10module LogService { 
    1111    interface LogProducer : LogStatus { 
    1212    oneway void write_records( 
  • platform/logService/CosLwLogService.idl

    r3615 r3743  
    1010#endif 
    1111 
    12 module CosLwLog 
     12module LogService  
    1313{ 
    1414    interface Log : LogAdministrator, LogConsumer, LogProducer {}; 
  • platform/logService/CosLwLogStatus.idl

    r3615 r3743  
    66#endif 
    77 
    8 module CosLwLog { 
     8module LogService { 
    99 
    1010//#ifndef _PRE_3_0_COMPILER_ 
  • platform/logService/LogAdministrator_impl.cpp

    r3633 r3743  
    11#include "LogAdministrator_impl.h" 
    22 
    3 void LogAdministrator_impl::set_max_size(CORBA::ULongLong size) 
    4     throw (CosLwLog::InvalidParam) 
     3void LogAdministrator_impl::setMaxSize(CORBA::ULongLong size) 
     4    throw (LogService::InvalidParam) 
    55{ 
    66    // 
     
    1010    // Assume zero max_length logs are invalid 
    1111    // 
     12    // Bad assumption, JTAP tests for 0 length log. 
     13    // 
    1214 
    13     if (size < 1) { 
    14         throw CosLwLog::InvalidParam("Log size must be greater than 0"); 
     15    if (size < 0) { 
     16        throw LogService::InvalidParam("Log size cannot be negative"); 
    1517    } 
    1618 
     
    3133} 
    3234 
    33 void LogAdministrator_impl::set_log_full_action(CosLwLog::LogFullAction action) 
     35void LogAdministrator_impl::setLogFullAction(LogService::LogFullAction action) 
    3436{ 
    3537    log_full_action = action; 
    3638} 
    3739 
    38 void LogAdministrator_impl::set_administrative_state( 
    39     CosLwLog::AdministrativeState state) 
     40void LogAdministrator_impl::setAdministrativeState( 
     41    LogService::AdministrativeState state) 
    4042{ 
    4143    administrative_state = state; 
    4244     
    43     if (administrative_state == CosLwLog::locked) { 
     45    if (administrative_state == LogService::locked) { 
    4446       availability_status.off_duty = true; 
    4547    } 
    46     else if (administrative_state == CosLwLog::unlocked &&  
    47              operational_state == CosLwLog::enabled) { 
     48    else if (administrative_state == LogService::unlocked &&  
     49             operational_state == LogService::enabled) { 
    4850        availability_status.off_duty = false; 
    4951    } 
    5052} 
    5153 
    52 void LogAdministrator_impl::clear_log() 
     54void LogAdministrator_impl::clearLog() 
    5355{ 
    5456    // 
  • platform/logService/LogAdministrator_impl.h

    r3630 r3743  
    1 #include "CosLwLogAdministrator.h" 
     1#include "LogServiceAdministrator.h" 
    22 
    33#ifndef LOGSTATUS_IMPL_H 
     
    66#endif 
    77 
    8 class LogAdministrator_impl : public virtual POA_CosLwLog::LogAdministrator, 
     8class LogAdministrator_impl : public virtual POA_LogService::LogAdministrator, 
    99                              public virtual LogStatus_impl 
    1010{ 
     
    1717    ~LogAdministrator_impl(); 
    1818 
    19     void set_max_size(CORBA::ULongLong size) 
    20         throw (CosLwLog::InvalidParam); 
    21     void set_log_full_action(CosLwLog::LogFullAction action); 
    22     void set_administrative_state(CosLwLog::AdministrativeState state); 
    23     void clear_log(); 
     19    void setMaxSize(CORBA::ULongLong size) 
     20        throw (LogService::InvalidParam); 
     21    void setLogFullAction(LogService::LogFullAction action); 
     22    void setAdministrativeState(LogService::AdministrativeState state); 
     23    void clearLog(); 
    2424    void destroy(); 
    2525 
  • platform/logService/LogConsumer_impl.cpp

    r3732 r3743  
    11#include "LogConsumer_impl.h" 
    22 
    3 CosLwLog::RecordId 
    4 LogConsumer_impl::get_record_id_from_time(const CosLwLog::LogTime& fromTime) 
     3LogService::RecordId 
     4LogConsumer_impl::getRecordIdFromTime(const LogService::LogTime& fromTime) 
    55{ 
    66    // 
     
    1111} 
    1212 
    13 CosLwLog::LogRecordSequence* 
    14 LogConsumer_impl::retrieve_records(CosLwLog::RecordId& currentId, CORBA::ULong& 
     13LogService::LogRecordSequence* 
     14LogConsumer_impl::retrieveRecords(LogService::RecordId& currentId, CORBA::ULong& 
    1515    howMany) 
    1616{ 
     
    2222    //  
    2323 
    24     CosLwLog::LogRecordSequence* return_sequence; 
     24    LogService::LogRecordSequence* return_sequence; 
    2525 
    2626    test_mutex->acquire(); 
    2727 
    28     return_sequence = new CosLwLog::LogRecordSequence(*log_record_sequence); 
     28    return_sequence = new LogService::LogRecordSequence(*log_record_sequence); 
    2929    return_sequence->length(log_record_size); 
    3030 
     
    3434} 
    3535 
    36 CosLwLog::LogRecordSequence*  
    37 LogConsumer_impl::retrieve_records_by_level(CosLwLog::RecordId& currentId, 
    38     CORBA::ULong& howMany, const CosLwLog::LogLevelSequence& valueList) 
     36LogService::LogRecordSequence*  
     37LogConsumer_impl::retrieveRecordsByLevel(LogService::RecordId& currentId, 
     38    CORBA::ULong& howMany, const LogService::LogLevelSequence& valueList) 
    3939{ 
    4040    // 
     
    4545} 
    4646 
    47 CosLwLog::LogRecordSequence*  
    48 LogConsumer_impl::retrieve_records_by_producer_id(CosLwLog::RecordId& currentId,  
    49     CORBA::ULong& howMany, const CosLwLog::StringSeq& valueList) 
     47LogService::LogRecordSequence*  
     48LogConsumer_impl::retrieveRecordsByProducerId(LogService::RecordId& currentId,  
     49    CORBA::ULong& howMany, const LogService::StringSeq& valueList) 
    5050{ 
    5151    // 
     
    5656} 
    5757 
    58 CosLwLog::LogRecordSequence*  
    59 LogConsumer_impl::retrieve_records_by_producer_name(CosLwLog::RecordId& currentId,  
    60     CORBA::ULong& howMany, const CosLwLog::StringSeq& valueList) 
     58LogService::LogRecordSequence*  
     59LogConsumer_impl::retrieveRecordsByProducerName(LogService::RecordId& currentId,  
     60    CORBA::ULong& howMany, const LogService::StringSeq& valueList) 
    6161{ 
    6262    // 
  • platform/logService/LogConsumer_impl.h

    r3574 r3743  
    1 #include "CosLwLogConsumer.h" 
     1#include "LogServiceConsumer.h" 
    22 
    33#ifndef LOGSTATUS_IMPL_H 
     
    66#endif 
    77 
    8 class LogConsumer_impl : public virtual POA_CosLwLog::LogConsumer, 
     8class LogConsumer_impl : public virtual POA_LogService::LogConsumer, 
    99                         public virtual LogStatus_impl 
    1010{ 
     
    1717    ~LogConsumer_impl(); 
    1818 
    19     CosLwLog::RecordId get_record_id_from_time(const CosLwLog::LogTime& 
     19    LogService::RecordId getRecordIdFromTime(const LogService::LogTime& 
    2020        fromTime); 
    2121 
    22     CosLwLog::LogRecordSequence* retrieve_records(CosLwLog::RecordId& currentId, 
     22    LogService::LogRecordSequence* retrieveRecords(LogService::RecordId& currentId, 
    2323        CORBA::ULong& howMany); 
    2424 
    25     CosLwLog::LogRecordSequence* retrieve_records_by_level(CosLwLog::RecordId& 
    26         currentId, CORBA::ULong& howMany, const CosLwLog::LogLevelSequence& 
     25    LogService::LogRecordSequence* retrieveRecordsByLevel(LogService::RecordId& 
     26        currentId, CORBA::ULong& howMany, const LogService::LogLevelSequence& 
    2727        valueList); 
    2828 
    29     CosLwLog::LogRecordSequence* retrieve_records_by_producer_id( 
    30         CosLwLog::RecordId& currentId, CORBA::ULong& howMany, const 
    31         CosLwLog::StringSeq& valueList); 
     29    LogService::LogRecordSequence* retrieveRecordsByProducer_id( 
     30        LogService::RecordId& currentId, CORBA::ULong& howMany, const 
     31        LogService::StringSeq& valueList); 
    3232 
    33     CosLwLog::LogRecordSequence* retrieve_records_by_producer_name( 
    34         CosLwLog::RecordId& currentId, CORBA::ULong& howMany, const 
    35         CosLwLog::StringSeq& valueList); 
     33    LogService::LogRecordSequence* retrieveRecordsByProducerName( 
     34        LogService::RecordId& currentId, CORBA::ULong& howMany, const 
     35        LogService::StringSeq& valueList); 
    3636}; 
  • platform/logService/LogProducer_impl.cpp

    r3629 r3743  
    44 
    55void  
    6 LogProducer_impl::write_records(const CosLwLog::ProducerLogRecordSequence&  
     6LogProducer_impl::write_records(const LogService::ProducerLogRecordSequence&  
    77    records) 
    88{ 
     
    1313 
    1414void 
    15 LogProducer_impl::write_record(const CosLwLog::ProducerLogRecord& record) 
     15LogProducer_impl::write_record(const LogService::ProducerLogRecord& record) 
    1616{ 
    1717    if (!availability_status.off_duty) { 
     
    2424        } 
    2525 
    26         CosLwLog::LogTime time; 
     26        LogService::LogTime time; 
    2727        time.seconds = tv.tv_sec; 
    2828        time.nanoseconds = tv.tv_usec * 1000; 
    2929   
    3030        // Assign unique 64bit id 
    31         CosLwLog::RecordId id = currentId++; 
     31        LogService::RecordId id = currentId++; 
    3232   
    3333        // Create new log entry 
    34         CosLwLog::LogRecord newLogRecord; 
     34        LogService::LogRecord newLogRecord; 
    3535        newLogRecord.id = id; 
    3636        newLogRecord.time = time;  
  • platform/logService/LogProducer_impl.h

    r3574 r3743  
    1 #include <CosLwLogProducer.h> 
     1#include <LogServiceProducer.h> 
    22 
    33#ifndef LOGSTATUS_IMPL_H 
     
    66#endif 
    77 
    8 class LogProducer_impl : public virtual POA_CosLwLog::LogProducer,  
     8class LogProducer_impl : public virtual POA_LogService::LogProducer,  
    99                         public virtual LogStatus_impl 
    1010{ 
     
    1616    ~LogProducer_impl(); 
    1717 
    18     void write_records(const CosLwLog::ProducerLogRecordSequence& records); 
    19     void write_record(const CosLwLog::ProducerLogRecord& record); 
     18    void write_records(const LogService::ProducerLogRecordSequence& records); 
     19    void write_record(const LogService::ProducerLogRecord& record); 
    2020 
    2121}; 
  • platform/logService/LogStatus_impl.cpp

    r3629 r3743  
    1616    log_record_max_size = max_size; 
    1717 
    18     log_record_sequence = new CosLwLog::LogRecordSequence(); 
     18    log_record_sequence = new LogService::LogRecordSequence(); 
    1919    log_record_sequence->length(max_size); 
    2020 
    21     operational_state = CosLwLog::enabled; 
    22     administrative_state = CosLwLog::unlocked; 
    23     log_full_action = CosLwLog::HALT; 
     21    operational_state = LogService::enabled; 
     22    administrative_state = LogService::unlocked; 
     23    log_full_action = LogService::HALT; 
    2424 
    2525    availability_status.off_duty = 0; 
     
    4141} 
    4242 
    43 unsigned long long LogStatus_impl::get_max_size() 
     43unsigned long long LogStatus_impl::getMaxSize() 
    4444{ 
    45     return log_record_max_size; 
     45    unsigned long long returnSize = log_record_max_size; 
     46    return returnSize; 
    4647} 
    4748 
    48 unsigned long long LogStatus_impl::get_current_size() 
     49unsigned long long LogStatus_impl::getCurrentSize() 
    4950{ 
    5051    return log_record_size; 
    5152} 
    5253 
    53 unsigned long long LogStatus_impl::get_n_records() 
     54unsigned long long LogStatus_impl::getNumRecords() 
    5455{ 
    55     // Figure what this should do 
    56     return 0; 
     56    unsigned long long returnVal = log_record_size; 
     57    return returnVal; 
    5758} 
    5859 
    59 CosLwLog::LogFullAction LogStatus_impl::get_log_full_action() 
     60LogService::LogFullAction LogStatus_impl::getLogFullAction() 
    6061{ 
    6162    return log_full_action; 
    6263} 
    6364 
    64 CosLwLog::AvailabilityStatus LogStatus_impl::get_availability_status() 
     65LogService::AvailabilityStatus LogStatus_impl::getAvailabilityStatus() 
    6566{ 
    66     return availability_status; 
     67    std::cout << "In getAvailabilityStatus()" << std::endl; 
     68 
     69    LogService::AvailabilityStatus returnStatus = availability_status; 
     70    return returnStatus; 
    6771} 
    6872 
    69 CosLwLog::AdministrativeState LogStatus_impl::get_administrative_state() 
     73LogService::AdministrativeState LogStatus_impl::getAdministrativeState() 
    7074{ 
    7175    return administrative_state; 
    7276} 
    7377 
    74 CosLwLog::OperationalState LogStatus_impl::get_operational_state() 
     78LogService::OperationalState LogStatus_impl::getOperationalState() 
    7579{ 
    7680    return operational_state; 
  • platform/logService/LogStatus_impl.h

    r3627 r3743  
    1 #include "CosLwLogStatus.h" 
     1#include "LogServiceStatus.h" 
    22 
    33#define MAX_SIZE_DEFAULT 1000 
    44 
    5 class LogStatus_impl : public virtual POA_CosLwLog::LogStatus 
     5class LogStatus_impl : public virtual POA_LogService::LogStatus 
    66{ 
    77 
     
    1111    omni_mutex *test_mutex; 
    1212 
    13     CosLwLog::LogRecordSequence* log_record_sequence; 
    14     CosLwLog::OperationalState operational_state; 
    15     CosLwLog::AdministrativeState administrative_state; 
    16     CosLwLog::LogFullAction log_full_action; 
    17     CosLwLog::AvailabilityStatus availability_status; 
     13    LogService::LogRecordSequence* log_record_sequence; 
     14    LogService::OperationalState operational_state; 
     15    LogService::AdministrativeState administrative_state; 
     16    LogService::LogFullAction log_full_action; 
     17    LogService::AvailabilityStatus availability_status; 
    1818 
    1919    unsigned int log_record_max_size; 
     
    2626    ~LogStatus_impl(); 
    2727 
    28     unsigned long long get_max_size(); 
    29     unsigned long long get_current_size(); 
    30     unsigned long long get_n_records(); 
    31     CosLwLog::LogFullAction get_log_full_action(); 
    32     CosLwLog::AdministrativeState get_administrative_state(); 
    33     CosLwLog::AvailabilityStatus get_availability_status(); 
    34     CosLwLog::OperationalState get_operational_state(); 
     28    unsigned long long getMaxSize(); 
     29    unsigned long long getCurrentSize(); 
     30    unsigned long long getNumRecords(); 
     31    LogService::LogFullAction getLogFullAction(); 
     32    LogService::AdministrativeState getAdministrativeState(); 
     33    LogService::AvailabilityStatus getAvailabilityStatus(); 
     34    LogService::OperationalState getOperationalState(); 
    3535 
    3636}; 
  • platform/logService/Log_impl.h

    r3574 r3743  
    33#include "LogConsumer_impl.h" 
    44 
    5 #include "CosLwLogService.h" 
     5#include "LogService.h" 
    66 
    7 struct Log_impl : public POA_CosLwLog::Log, 
     7struct Log_impl : public POA_LogService::Log, 
    88                  public LogProducer_impl, 
    99                  public LogAdministrator_impl, 
  • platform/logService/Makefile

    r3732 r3743  
    11CFLAGS = -Wall 
    2 SOURCES = LogStatus_impl.cpp LogProducer_impl.cpp LogConsumer_impl.cpp LogAdministrator_impl.cpp Log_impl.cpp main.cpp CosLwLogStatusSK.cpp CosLwLogProducerSK.cpp CosLwLogConsumerSK.cpp CosLwLogAdministratorSK.cpp CosLwLogServiceSK.cpp 
    3 LIBS = -lomniORB4 -lossieidl 
     2SOURCES = LogStatus_impl.cpp LogProducer_impl.cpp LogConsumer_impl.cpp LogAdministrator_impl.cpp Log_impl.cpp main.cpp LogServiceStatusSK.cpp LogServiceProducerSK.cpp LogServiceConsumerSK.cpp LogServiceAdministratorSK.cpp LogServiceSK.cpp cfSK.cpp 
     3LIBS = -lomniORB4  
    44INCLUDE = -I. 
    55 
  • platform/logService/main.cpp

    r3732 r3743  
    11#include "Log_impl.h" 
    2 #include "ossie/cf.h" 
     2#include "cf.h" 
    33 
    44#include <iostream> 
     
    2424    Log_impl* log_servant = new Log_impl(1000); 
    2525    PortableServer::ObjectId_var log_id = poa->activate_object(log_servant); 
    26     CosLwLog::Log_var log_var = log_servant->_this(); 
     26    LogService::Log_ptr log_ptr = log_servant->_this(); 
    2727 
    2828    CosNaming::Name_var cosName = rootContext->to_name("DomainName1/Log"); 
    29     rootContext->rebind(cosName, log_var); 
     29    rootContext->rebind(cosName, log_ptr); 
    3030 
    3131    PortableServer::POAManager_var pman = poa->the_POAManager(); 
     
    5858 
    5959    std::cout << "Calling registerService on DeviceaManager" << std::endl; 
    60     deviceManager->registerService(log_var, "Log"); 
     60    deviceManager->registerService(log_ptr, "Log"); 
     61    std::cout << "Service registered" << std::endl; 
     62 
     63    std::cout << orb->object_to_string(log_ptr) << std::endl; 
    6164 
    6265    //