version 1.8.2.1, 2006/06/23 17:44:59
|
version 1.11, 2008/01/08 20:15:15
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Chip Vincent (cvincent@us.ibm.com) |
|
// |
|
// Modified By: |
|
// Mark Hamzy (hamzy@us.ibm.com) |
|
// Nag Boranna, Hewlett-Packard Company(nagaraja_boranna@hp.com) |
|
// Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com) |
|
// Mike Day, IBM (mdday@us.ibm.com) |
|
// Adrian Schuur, IBM (schuur@de.ibm.com) |
|
// Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) for PEP#101 |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
// NOCHKSRC |
|
|
#include "JMPIProviderModule.h" | #include "JMPIProviderModule.h" |
| |
#include <Pegasus/Common/FileSystem.h> | #include <Pegasus/Common/FileSystem.h> |
#include <Pegasus/Common/MessageLoader.h> //l10n |
#include <Pegasus/Common/MessageLoader.h> |
#include <Pegasus/Config/ConfigManager.h> | #include <Pegasus/Config/ConfigManager.h> |
#include <Pegasus/ProviderManager2/JMPI/JMPIProvider.h> | #include <Pegasus/ProviderManager2/JMPI/JMPIProvider.h> |
#include <Pegasus/ProviderManager2/JMPI/JMPIProviderManager.h> | #include <Pegasus/ProviderManager2/JMPI/JMPIProviderManager.h> |
|
|
JMPIProviderModule::JMPIProviderModule (const String & fileName, | JMPIProviderModule::JMPIProviderModule (const String & fileName, |
const String & interfaceName) | const String & interfaceName) |
: _fileName (fileName), | : _fileName (fileName), |
_interfaceName (interfaceName), |
_interfaceName (interfaceName) |
_ref_count (0), |
|
_library (0) |
|
{ | { |
Uint32 i = fileName.find (".jar:"); | Uint32 i = fileName.find (".jar:"); |
| |
|
|
{ | { |
String s0 = "ProviderLoadFailure"; | String s0 = "ProviderLoadFailure"; |
| |
throw Exception (MessageLoaderParms ("ProviderManager.JMPIProviderModule.CANNOT_LOAD_LIBRARY", |
throw Exception(MessageLoaderParms( |
"$0 ($1:$2):Cannot load library", |
"ProviderManager.JMPI.JMPIProviderModule.CANNOT_LOAD_LIBRARY", |
|
"$0 ($1:$2): Cannot load library.", |
s0, | s0, |
_fileName, | _fileName, |
providerName)); | providerName)); |
} | } |
| |
_ref_count++; |
|
|
|
return pv; | return pv; |
} | } |
| |
void JMPIProviderModule::unloadModule (void) | void JMPIProviderModule::unloadModule (void) |
{ | { |
if (_ref_count.decAndTestIfZero ()) |
|
{ |
|
if (_library != 0) |
|
{ |
|
System::unloadDynamicLibrary (_library); |
|
|
|
_library = 0; |
|
} |
|
} |
|
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |