summaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorJörg Budischewski <jbu@openoffice.org>2001-06-22 15:32:57 +0000
committerJörg Budischewski <jbu@openoffice.org>2001-06-22 15:32:57 +0000
commit4409e1cfb5d33e57c1eba238bd5ab9d153cbbacd (patch)
treeb5a5977d54c51cd971011c26286c922acdd272c9 /io
parenta242da96dcd112e05ce9fa7f309d6618c61994f9 (diff)
#67468# Added unloading and context support
Diffstat (limited to 'io')
-rw-r--r--io/source/TextInputStream/TextInputStream.cxx109
-rw-r--r--io/source/TextInputStream/makefile.mk6
-rw-r--r--io/source/TextInputStream/tinstrm.map10
-rw-r--r--io/source/TextOutputStream/TextOutputStream.cxx109
-rw-r--r--io/source/TextOutputStream/makefile.mk7
-rw-r--r--io/source/TextOutputStream/toutstrm.map10
-rw-r--r--io/source/acceptor/acc_pipe.cxx12
-rw-r--r--io/source/acceptor/acc_socket.cxx11
-rw-r--r--io/source/acceptor/acceptor.cxx130
-rw-r--r--io/source/acceptor/acceptor.hxx10
-rw-r--r--io/source/acceptor/acceptor.map10
-rw-r--r--io/source/acceptor/makefile.mk6
-rw-r--r--io/source/connector/connector.cxx135
-rw-r--r--io/source/connector/connector.hxx9
-rw-r--r--io/source/connector/connectr.map10
-rw-r--r--io/source/connector/ctr_pipe.cxx10
-rw-r--r--io/source/connector/ctr_socket.cxx10
-rw-r--r--io/source/connector/makefile.mk6
-rw-r--r--io/source/stm/factreg.cxx199
-rw-r--r--io/source/stm/factreg.hxx33
-rw-r--r--io/source/stm/makefile.mk6
-rw-r--r--io/source/stm/odata.cxx183
-rw-r--r--io/source/stm/omark.cxx39
-rw-r--r--io/source/stm/opipe.cxx22
-rw-r--r--io/source/stm/opump.cxx15
-rw-r--r--io/source/stm/stm.map10
26 files changed, 566 insertions, 551 deletions
diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx
index 6d381413528e..88b986245d70 100644
--- a/io/source/TextInputStream/TextInputStream.cxx
+++ b/io/source/TextInputStream/TextInputStream.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TextInputStream.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: ab $ $Date: 2001-04-27 15:10:58 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -64,16 +64,20 @@
#include <osl/mutex.hxx>
#include <osl/diagnose.h>
+#include <rtl/unload.h>
+
#include <uno/mapping.hxx>
#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implementationentry.hxx>
#include <rtl/textenc.h>
#include <rtl/tencinfo.h>
#include <com/sun/star/io/XTextInputStream.hpp>
#include <com/sun/star/io/XActiveDataSink.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#define IMPLEMENTATION_NAME "com.sun.star.comp.io.TextInputStream"
@@ -88,13 +92,14 @@ using namespace ::com::sun::star::io;
using namespace ::com::sun::star::registry;
-namespace io_TextStream
+namespace io_TextInputStream
{
+ rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
//===========================================================================
// Implementation XTextInputStream
-typedef WeakImplHelper2< XTextInputStream, XActiveDataSink > TextInputStreamHelper;
+typedef WeakImplHelper3< XTextInputStream, XActiveDataSink, XServiceInfo > TextInputStreamHelper;
class OCommandEnvironment;
#define INITIAL_UNICODE_BUFFER_CAPACITY 0x100
@@ -153,12 +158,18 @@ public:
throw(RuntimeException);
virtual Reference< XInputStream > SAL_CALL getInputStream()
throw(RuntimeException);
+
+ // Methods XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() SAL_THROW( () );
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames(void) SAL_THROW( () );
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) SAL_THROW( () );
};
OTextInputStream::OTextInputStream()
: mSeqSource( READ_BYTE_COUNT ), mpBuffer( NULL ), mnBufferSize( 0 )
, mnCharsInBuffer( 0 ), mbReachedEOF( sal_False )
{
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
mbEncodingInitialized = false;
}
@@ -169,6 +180,7 @@ OTextInputStream::~OTextInputStream()
rtl_destroyUnicodeToTextContext( mConvText2Unicode, mContextText2Unicode );
rtl_destroyUnicodeToTextConverter( mConvText2Unicode );
}
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
}
void OTextInputStream::implResizeBuffer( void )
@@ -462,11 +474,15 @@ Reference< XInputStream > OTextInputStream::getInputStream()
}
-Reference< XInterface > SAL_CALL TextInputStream_CreateInstance( const Reference< XMultiServiceFactory > &)
+Reference< XInterface > SAL_CALL TextInputStream_CreateInstance( const Reference< XComponentContext > &)
{
return Reference < XInterface >( ( OWeakObject * ) new OTextInputStream() );
}
+OUString TextInputStream_getImplementationName()
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
+}
Sequence< OUString > TextInputStream_getSupportedServiceNames()
{
@@ -477,22 +493,56 @@ Sequence< OUString > TextInputStream_getSupportedServiceNames()
if( !pNames )
{
static Sequence< OUString > seqNames(1);
- seqNames.getArray()[0] = OUString::createFromAscii( SERVICE_NAME );
+ seqNames.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME ) );
pNames = &seqNames;
}
}
return *pNames;
}
+OUString OTextInputStream::getImplementationName() SAL_THROW( () )
+{
+ return TextInputStream_getImplementationName();
+}
+
+sal_Bool OTextInputStream::supportsService(const OUString& ServiceName) SAL_THROW( () )
+{
+ Sequence< OUString > aSNL = getSupportedServiceNames();
+ const OUString * pArray = aSNL.getConstArray();
+
+ for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
+ if( pArray[i] == ServiceName )
+ return sal_True;
+
+ return sal_False;
+}
+
+Sequence< OUString > OTextInputStream::getSupportedServiceNames(void) SAL_THROW( () )
+{
+ return TextInputStream_getSupportedServiceNames();
+}
}
+using namespace io_TextInputStream;
-//==================================================================================================
-// Component exports
+static struct ImplementationEntry g_entries[] =
+{
+ {
+ TextInputStream_CreateInstance, TextInputStream_getImplementationName ,
+ TextInputStream_getSupportedServiceNames, createSingleComponentFactory ,
+ &g_moduleCount.modCnt , 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
+};
extern "C"
{
+sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
+{
+ return g_moduleCount.canUnload( &g_moduleCount , pTime );
+}
+
//==================================================================================================
void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
@@ -503,50 +553,13 @@ void SAL_CALL component_getImplementationEnvironment(
sal_Bool SAL_CALL component_writeInfo(
void * pServiceManager, void * pRegistryKey )
{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString::createFromAscii("/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
-
- const Sequence< OUString > & rSNL = io_TextStream::TextInputStream_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
+ return component_writeInfoHelper( pServiceManager, pRegistryKey, g_entries );
}
//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
- void * pRet = 0;
-
- if (pServiceManager && rtl_str_compare( pImplName, IMPLEMENTATION_NAME ) == 0)
- {
- Reference< XSingleServiceFactory > xFactory( createSingleFactory(
- reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
- OUString::createFromAscii( pImplName ),
- io_TextStream::TextInputStream_CreateInstance,
- io_TextStream::TextInputStream_getSupportedServiceNames() ) );
-
- if (xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
-
- return pRet;
+ return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
}
}
diff --git a/io/source/TextInputStream/makefile.mk b/io/source/TextInputStream/makefile.mk
index 544a9c9c78f5..a4656e27d80a 100644
--- a/io/source/TextInputStream/makefile.mk
+++ b/io/source/TextInputStream/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.8 $
+# $Revision: 1.9 $
#
-# last change: $Author: kz $ $Date: 2001-05-15 08:37:58 $
+# last change: $Author: jbu $ $Date: 2001-06-22 16:32:49 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -84,6 +84,7 @@ UNOTYPES= com.sun.star.io.XTextInputStream \
com.sun.star.lang.XSingleServiceFactory \
com.sun.star.lang.XMultiServiceFactory \
com.sun.star.lang.XTypeProvider \
+ com.sun.star.lang.XServiceInfo \
com.sun.star.registry.XRegistryKey \
com.sun.star.uno.XAggregation \
com.sun.star.uno.XWeak \
@@ -93,6 +94,7 @@ SLOFILES= \
$(SLO)$/TextInputStream.obj
SHL1TARGET= $(TARGET)
+SHL1VERSIONMAP= $(TARGET).map
SHL1STDLIBS= \
$(SALLIB) \
diff --git a/io/source/TextInputStream/tinstrm.map b/io/source/TextInputStream/tinstrm.map
new file mode 100644
index 000000000000..f76809fbd37b
--- /dev/null
+++ b/io/source/TextInputStream/tinstrm.map
@@ -0,0 +1,10 @@
+UDK_3_0_0 {
+ global:
+ component_getImplementationEnvironment;
+ component_writeInfo;
+ component_getFactory;
+ component_canUnload;
+ component_getDescriptionFunc;
+ local:
+ *;
+};
diff --git a/io/source/TextOutputStream/TextOutputStream.cxx b/io/source/TextOutputStream/TextOutputStream.cxx
index c6cb13ee7901..19407c9575c2 100644
--- a/io/source/TextOutputStream/TextOutputStream.cxx
+++ b/io/source/TextOutputStream/TextOutputStream.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TextOutputStream.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jl $ $Date: 2001-03-12 15:50:46 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,13 +66,16 @@
#include <uno/mapping.hxx>
#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implementationentry.hxx>
#include <rtl/textenc.h>
#include <rtl/tencinfo.h>
+#include <rtl/unload.h>
#include <com/sun/star/io/XTextOutputStream.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#define IMPLEMENTATION_NAME "com.sun.star.comp.io.TextOutputStream"
@@ -87,13 +90,13 @@ using namespace ::com::sun::star::io;
using namespace ::com::sun::star::registry;
-namespace io_TextStream
+namespace io_TextOutputStream
{
-
+ rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
//===========================================================================
// Implementation XTextOutputStream
-typedef WeakImplHelper2< XTextOutputStream, XActiveDataSource > TextOutputStreamHelper;
+typedef WeakImplHelper3< XTextOutputStream, XActiveDataSource, XServiceInfo > TextOutputStreamHelper;
class OCommandEnvironment;
class OTextOutputStream : public TextOutputStreamHelper
@@ -131,6 +134,11 @@ public:
throw(RuntimeException);
virtual Reference< XOutputStream > SAL_CALL getOutputStream( )
throw(RuntimeException);
+
+ // Methods XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() SAL_THROW( () );
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames(void) SAL_THROW( () );
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) SAL_THROW( () );
};
OTextOutputStream::OTextOutputStream()
@@ -265,11 +273,16 @@ Reference< XOutputStream > OTextOutputStream::getOutputStream()
}
-Reference< XInterface > SAL_CALL TextOutputStream_CreateInstance( const Reference< XMultiServiceFactory > &)
+Reference< XInterface > SAL_CALL TextOutputStream_CreateInstance( const Reference< XComponentContext > &)
{
return Reference < XInterface >( ( OWeakObject * ) new OTextOutputStream() );
}
+OUString TextOutputStream_getImplementationName() SAL_THROW( () )
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
+}
+
Sequence< OUString > TextOutputStream_getSupportedServiceNames()
{
@@ -280,22 +293,57 @@ Sequence< OUString > TextOutputStream_getSupportedServiceNames()
if( !pNames )
{
static Sequence< OUString > seqNames(1);
- seqNames.getArray()[0] = OUString::createFromAscii( SERVICE_NAME );
+ seqNames.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME ) );
pNames = &seqNames;
}
}
return *pNames;
}
+OUString OTextOutputStream::getImplementationName() SAL_THROW( () )
+{
+ return TextOutputStream_getImplementationName();
+}
+
+sal_Bool OTextOutputStream::supportsService(const OUString& ServiceName) SAL_THROW( () )
+{
+ Sequence< OUString > aSNL = getSupportedServiceNames();
+ const OUString * pArray = aSNL.getConstArray();
+
+ for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
+ if( pArray[i] == ServiceName )
+ return sal_True;
+ return sal_False;
}
+Sequence< OUString > OTextOutputStream::getSupportedServiceNames(void) SAL_THROW( () )
+{
+ return TextOutputStream_getSupportedServiceNames();
+}
-//==================================================================================================
-// Component exports
+
+}
+
+using namespace io_TextOutputStream;
+
+static struct ImplementationEntry g_entries[] =
+{
+ {
+ TextOutputStream_CreateInstance, TextOutputStream_getImplementationName ,
+ TextOutputStream_getSupportedServiceNames, createSingleComponentFactory ,
+ &g_moduleCount.modCnt , 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
+};
extern "C"
{
+sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
+{
+ return g_moduleCount.canUnload( &g_moduleCount , pTime );
+}
+
//==================================================================================================
void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
@@ -306,50 +354,13 @@ void SAL_CALL component_getImplementationEnvironment(
sal_Bool SAL_CALL component_writeInfo(
void * pServiceManager, void * pRegistryKey )
{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString::createFromAscii("/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
-
- const Sequence< OUString > & rSNL = io_TextStream::TextOutputStream_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
+ return component_writeInfoHelper( pServiceManager, pRegistryKey, g_entries );
}
//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
- void * pRet = 0;
-
- if (pServiceManager && rtl_str_compare( pImplName, IMPLEMENTATION_NAME ) == 0)
- {
- Reference< XSingleServiceFactory > xFactory( createSingleFactory(
- reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
- OUString::createFromAscii( pImplName ),
- io_TextStream::TextOutputStream_CreateInstance,
- io_TextStream::TextOutputStream_getSupportedServiceNames() ) );
-
- if (xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
-
- return pRet;
+ return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
}
}
diff --git a/io/source/TextOutputStream/makefile.mk b/io/source/TextOutputStream/makefile.mk
index b1e95544e152..9ae20a2dc8d4 100644
--- a/io/source/TextOutputStream/makefile.mk
+++ b/io/source/TextOutputStream/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.8 $
+# $Revision: 1.9 $
#
-# last change: $Author: jbu $ $Date: 2001-05-15 08:12:05 $
+# last change: $Author: jbu $ $Date: 2001-06-22 16:32:53 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -83,6 +83,7 @@ UNOTYPES= com.sun.star.io.XTextOutputStream \
com.sun.star.lang.XMultiServiceFactory \
com.sun.star.lang.XTypeProvider \
com.sun.star.lang.XSingleComponentFactory \
+ com.sun.star.lang.XServiceInfo \
com.sun.star.uno.XComponentContext \
com.sun.star.registry.XRegistryKey \
com.sun.star.uno.XAggregation \
@@ -92,6 +93,7 @@ SLOFILES= \
$(SLO)$/TextOutputStream.obj
SHL1TARGET= $(TARGET)
+SHL1VERSIONMAP= $(TARGET).map
SHL1STDLIBS= \
$(SALLIB) \
@@ -104,7 +106,6 @@ SHL1LIBS= $(SLB)$/$(TARGET).lib
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
# --- Targets ------------------------------------------------------
diff --git a/io/source/TextOutputStream/toutstrm.map b/io/source/TextOutputStream/toutstrm.map
new file mode 100644
index 000000000000..f76809fbd37b
--- /dev/null
+++ b/io/source/TextOutputStream/toutstrm.map
@@ -0,0 +1,10 @@
+UDK_3_0_0 {
+ global:
+ component_getImplementationEnvironment;
+ component_writeInfo;
+ component_getFactory;
+ component_canUnload;
+ component_getDescriptionFunc;
+ local:
+ *;
+};
diff --git a/io/source/acceptor/acc_pipe.cxx b/io/source/acceptor/acc_pipe.cxx
index 0dc396f6d52d..fa5cee72993a 100644
--- a/io/source/acceptor/acc_pipe.cxx
+++ b/io/source/acceptor/acc_pipe.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acc_pipe.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jbu $ $Date: 2001-03-15 11:10:54 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -82,6 +82,7 @@ namespace io_acceptor
{
public:
PipeConnection( const OUString & s , const OUString &sConnectionDescription);
+ ~PipeConnection();
virtual sal_Int32 SAL_CALL read( Sequence< sal_Int8 >& aReadBytes, sal_Int32 nBytesToRead )
throw(::com::sun::star::io::IOException,
@@ -109,11 +110,18 @@ namespace io_acceptor
m_nStatus( 0 ),
m_sDescription( sConnectionDescription )
{
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
+
// make it unique
m_sDescription += OUString::createFromAscii( ",uniqueValue=" );
m_sDescription += OUString::valueOf( (sal_Int64) &m_pipe , 10 );
}
+ PipeConnection::~PipeConnection()
+ {
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
+ }
+
sal_Int32 PipeConnection::read( Sequence < sal_Int8 > & aReadBytes , sal_Int32 nBytesToRead )
throw(::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException)
diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx
index 6c3570e2fda8..757a518db70a 100644
--- a/io/source/acceptor/acc_socket.cxx
+++ b/io/source/acceptor/acc_socket.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acc_socket.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: jbu $ $Date: 2001-04-11 15:43:48 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -110,6 +110,7 @@ namespace io_acceptor {
{
public:
SocketConnection( const ::rtl::OUString & s , sal_uInt16 nPort, const OUString & sConnectionDescription );
+ ~SocketConnection();
virtual sal_Int32 SAL_CALL read( ::com::sun::star::uno::Sequence< sal_Int8 >& aReadBytes,
sal_Int32 nBytesToRead )
@@ -203,11 +204,17 @@ namespace io_acceptor {
_closed(sal_False),
_error(sal_False)
{
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
// make it unique
m_sDescription += OUString( RTL_CONSTASCII_USTRINGPARAM( ",uniqueValue=" ) );
m_sDescription += OUString::valueOf( (sal_Int64) &m_socket , 10 );
}
+ SocketConnection::~SocketConnection()
+ {
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
+ }
+
void SocketConnection::completeConnectionString()
{
OUStringBuffer buf( 256 );
diff --git a/io/source/acceptor/acceptor.cxx b/io/source/acceptor/acceptor.cxx
index 60a832a7dd73..f532f5d543bb 100644
--- a/io/source/acceptor/acceptor.cxx
+++ b/io/source/acceptor/acceptor.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acceptor.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: tbe $ $Date: 2001-05-11 09:47:21 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -63,9 +63,11 @@
#include <uno/mapping.hxx>
#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implementationentry.hxx>
#include <com/sun/star/connection/XAcceptor.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include "acceptor.hxx"
@@ -83,14 +85,13 @@ using namespace ::com::sun::star::connection;
namespace io_acceptor
{
- typedef WeakImplHelper1< XAcceptor > MyImplHelper;
+ rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
- class OAcceptor : public MyImplHelper
+ class OAcceptor : public WeakImplHelper2< XAcceptor, XServiceInfo >
{
public:
- OAcceptor(Reference< XMultiServiceFactory > xMultiServiceFactory);
- ~OAcceptor();
-
+ OAcceptor(const Reference< XComponentContext > & xCtx);
+ virtual ~OAcceptor();
public:
// Methods
virtual Reference< XConnection > SAL_CALL accept( const OUString& sConnectionDescription )
@@ -100,23 +101,33 @@ namespace io_acceptor
RuntimeException);
virtual void SAL_CALL stopAccepting( ) throw( RuntimeException);
+ public: // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() SAL_THROW( () );
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames(void) SAL_THROW( () );
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) SAL_THROW( () );
+
+ private:
PipeAcceptor *m_pPipe;
SocketAcceptor *m_pSocket;
Mutex m_mutex;
OUString m_sLastDescription;
sal_Bool m_bInAccept;
- Reference<XMultiServiceFactory> _xMultiServiceFactory;
- Reference<XAcceptor> _xAcceptor;
+ Reference< XMultiComponentFactory > _xSMgr;
+ Reference< XComponentContext > _xCtx;
+ Reference<XAcceptor> _xAcceptor;
};
- OAcceptor::OAcceptor(Reference< XMultiServiceFactory > xMultiServiceFactory)
+ OAcceptor::OAcceptor( const Reference< XComponentContext > & xCtx )
: m_pPipe( 0 )
- ,m_pSocket( 0 )
- ,_xMultiServiceFactory(xMultiServiceFactory)
+ , m_pSocket( 0 )
+ , _xSMgr( xCtx->getServiceManager() )
+ , _xCtx( xCtx )
, m_bInAccept( sal_False )
- {}
+ {
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
+ }
OAcceptor::~OAcceptor()
{
@@ -128,6 +139,7 @@ namespace io_acceptor
{
delete m_pSocket;
}
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
}
// helper class
@@ -348,7 +360,8 @@ namespace io_acceptor
OString tmp = OUStringToOString(delegatee, RTL_TEXTENCODING_ASCII_US);
OSL_TRACE("trying to get service %s\n", tmp.getStr());
#endif
- _xAcceptor = Reference<XAcceptor>(_xMultiServiceFactory->createInstance(delegatee), UNO_QUERY);
+ _xAcceptor = Reference<XAcceptor>(
+ _xSMgr->createInstanceWithContext(delegatee, _xCtx), UNO_QUERY);
if(!_xAcceptor.is())
{
@@ -398,10 +411,14 @@ namespace io_acceptor
}
+ OUString acceptor_getImplementationName()
+ {
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
+ }
- Reference< XInterface > SAL_CALL acceptor_CreateInstance( const Reference< XMultiServiceFactory > & xMultiServiceFactory)
+ Reference< XInterface > SAL_CALL acceptor_CreateInstance( const Reference< XComponentContext > & xCtx)
{
- return Reference < XInterface >( ( OWeakObject * ) new OAcceptor(xMultiServiceFactory) );
+ return Reference < XInterface >( ( OWeakObject * ) new OAcceptor(xCtx) );
}
Sequence< OUString > acceptor_getSupportedServiceNames()
@@ -420,14 +437,51 @@ namespace io_acceptor
return *pNames;
}
+ OUString OAcceptor::getImplementationName() SAL_THROW( () )
+ {
+ return acceptor_getImplementationName();
+ }
+
+ sal_Bool OAcceptor::supportsService(const OUString& ServiceName) SAL_THROW( () )
+ {
+ Sequence< OUString > aSNL = getSupportedServiceNames();
+ const OUString * pArray = aSNL.getConstArray();
+
+ for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
+ if( pArray[i] == ServiceName )
+ return sal_True;
+
+ return sal_False;
+ }
+
+ Sequence< OUString > OAcceptor::getSupportedServiceNames(void) SAL_THROW( () )
+ {
+ return acceptor_getSupportedServiceNames();
+ }
+
+
}
using namespace io_acceptor;
-
+static struct ImplementationEntry g_entries[] =
+{
+ {
+ acceptor_CreateInstance, acceptor_getImplementationName ,
+ acceptor_getSupportedServiceNames, createSingleComponentFactory ,
+ &g_moduleCount.modCnt , 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
+};
extern "C"
{
+
+sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
+{
+ return g_moduleCount.canUnload( &g_moduleCount , pTime );
+}
+
//==================================================================================================
void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
@@ -438,49 +492,13 @@ void SAL_CALL component_getImplementationEnvironment(
sal_Bool SAL_CALL component_writeInfo(
void * pServiceManager, void * pRegistryKey )
{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString::createFromAscii("/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
-
- const Sequence< OUString > & rSNL = acceptor_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
+ return component_writeInfoHelper( pServiceManager, pRegistryKey, g_entries );
}
//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
- void * pRet = 0;
-
- if (pServiceManager && rtl_str_compare( pImplName, IMPLEMENTATION_NAME ) == 0)
- {
- Reference< XSingleServiceFactory > xFactory( createSingleFactory(
- reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
- OUString::createFromAscii( pImplName ),
- acceptor_CreateInstance, acceptor_getSupportedServiceNames() ) );
-
- if (xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
-
- return pRet;
+ return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
}
}
diff --git a/io/source/acceptor/acceptor.hxx b/io/source/acceptor/acceptor.hxx
index 8514756042d5..7a5b47066651 100644
--- a/io/source/acceptor/acceptor.hxx
+++ b/io/source/acceptor/acceptor.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acceptor.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jbu $ $Date: 2001-04-11 15:43:48 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,10 +67,16 @@
#include <osl/socket.hxx>
#endif
+#ifndef _RTL_UNLOAD_H_
+#include <rtl/unload.h>
+#endif
+
#include <com/sun/star/connection/XConnection.hpp>
namespace io_acceptor {
+ extern rtl_StandardModuleCount g_moduleCount;
+
class PipeAcceptor
{
public:
diff --git a/io/source/acceptor/acceptor.map b/io/source/acceptor/acceptor.map
new file mode 100644
index 000000000000..f76809fbd37b
--- /dev/null
+++ b/io/source/acceptor/acceptor.map
@@ -0,0 +1,10 @@
+UDK_3_0_0 {
+ global:
+ component_getImplementationEnvironment;
+ component_writeInfo;
+ component_getFactory;
+ component_canUnload;
+ component_getDescriptionFunc;
+ local:
+ *;
+};
diff --git a/io/source/acceptor/makefile.mk b/io/source/acceptor/makefile.mk
index c61c3a2a854d..139d69b85ece 100644
--- a/io/source/acceptor/makefile.mk
+++ b/io/source/acceptor/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.7 $
+# $Revision: 1.8 $
#
-# last change: $Author: jbu $ $Date: 2001-03-15 11:10:54 $
+# last change: $Author: jbu $ $Date: 2001-06-22 16:32:55 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -87,6 +87,7 @@ SLOFILES= \
$(SLO)$/acc_socket.obj
SHL1TARGET= $(TARGET)
+SHL1VERSIONMAP= $(TARGET).map
SHL1STDLIBS= \
$(SALLIB) \
@@ -99,7 +100,6 @@ SHL1LIBS= $(SLB)$/$(TARGET).lib
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx
index 7f42c7037056..1fceb35bd4b3 100644
--- a/io/source/connector/connector.cxx
+++ b/io/source/connector/connector.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: connector.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: tbe $ $Date: 2001-05-11 09:47:38 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -63,8 +63,10 @@
#include <uno/mapping.hxx>
#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implementationentry.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/connection/XConnector.hpp>
@@ -83,25 +85,36 @@ using namespace ::com::sun::star::connection;
namespace stoc_connector
{
- typedef WeakImplHelper1< XConnector > MyImplHelper;
+ rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
- class OConnector : public MyImplHelper
+ class OConnector : public WeakImplHelper2< XConnector, XServiceInfo >
{
- Reference< XMultiServiceFactory > _xMultiServiceFactory;
-
+ Reference< XMultiComponentFactory > _xSMgr;
+ Reference< XComponentContext > _xCtx;
public:
- OConnector(Reference< XMultiServiceFactory > xMultiServiceFactory);
-
+ OConnector(const Reference< XComponentContext > &xCtx);
+ ~OConnector();
// Methods
virtual Reference< XConnection > SAL_CALL OConnector::connect(
const OUString& sConnectionDescription )
throw( NoConnectException, ConnectionSetupException, RuntimeException);
+ public: // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() SAL_THROW( () );
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames(void) SAL_THROW( () );
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) SAL_THROW( () );
};
- OConnector::OConnector(Reference< XMultiServiceFactory > xMultiServiceFactory)
- : _xMultiServiceFactory(xMultiServiceFactory)
+ OConnector::OConnector(const Reference< XComponentContext > &xCtx)
+ : _xCtx( xCtx )
+ , _xSMgr( xCtx->getServiceManager() )
{
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
+ }
+
+ OConnector::~OConnector()
+ {
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
}
class TokenContainer
@@ -293,7 +306,8 @@ namespace stoc_connector
OString tmp = OUStringToOString(delegatee, RTL_TEXTENCODING_ASCII_US);
OSL_TRACE("connector: trying to get service %s\n", tmp.getStr());
#endif
- Reference<XConnector> xConnector(_xMultiServiceFactory->createInstance(delegatee), UNO_QUERY);
+ Reference<XConnector> xConnector(
+ _xSMgr->createInstanceWithContext(delegatee, _xCtx), UNO_QUERY );
if(!xConnector.is())
{
@@ -307,16 +321,9 @@ namespace stoc_connector
r = xConnector->connect(sConnectionDescription.copy(index + 1).trim());
}
-
return r;
}
-
- Reference< XInterface > SAL_CALL connector_CreateInstance( const Reference< XMultiServiceFactory > & xMultiServiceFactory)
- {
- return Reference < XInterface >( ( OWeakObject * ) new OConnector(xMultiServiceFactory) );
- }
-
Sequence< OUString > connector_getSupportedServiceNames()
{
static Sequence < OUString > *pNames = 0;
@@ -333,13 +340,60 @@ namespace stoc_connector
return *pNames;
}
-}
+ OUString connector_getImplementationName()
+ {
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
+ }
+ OUString OConnector::getImplementationName() SAL_THROW ( () )
+ {
+ return connector_getImplementationName();
+ }
+
+ sal_Bool OConnector::supportsService(const OUString& ServiceName) SAL_THROW( () )
+ {
+ Sequence< OUString > aSNL = getSupportedServiceNames();
+ const OUString * pArray = aSNL.getConstArray();
+
+ for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
+ if( pArray[i] == ServiceName )
+ return sal_True;
+
+ return sal_False;
+ }
+
+ Sequence< OUString > OConnector::getSupportedServiceNames(void) SAL_THROW( () )
+ {
+ return connector_getSupportedServiceNames();
+ }
+
+ Reference< XInterface > SAL_CALL connector_CreateInstance( const Reference< XComponentContext > & xCtx)
+ {
+ return Reference < XInterface >( ( OWeakObject * ) new OConnector(xCtx) );
+ }
+
+
+}
using namespace stoc_connector;
+static struct ImplementationEntry g_entries[] =
+{
+ {
+ connector_CreateInstance, connector_getImplementationName ,
+ connector_getSupportedServiceNames, createSingleComponentFactory ,
+ &g_moduleCount.modCnt , 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
+};
extern "C"
{
+
+sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
+{
+ return g_moduleCount.canUnload( &g_moduleCount , pTime );
+}
+
//==================================================================================================
void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
@@ -350,50 +404,15 @@ void SAL_CALL component_getImplementationEnvironment(
sal_Bool SAL_CALL component_writeInfo(
void * pServiceManager, void * pRegistryKey )
{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString::createFromAscii("/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
-
- const Sequence< OUString > & rSNL = connector_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
+ return component_writeInfoHelper( pServiceManager, pRegistryKey, g_entries );
}
//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
- void * pRet = 0;
-
- if (pServiceManager && rtl_str_compare( pImplName, IMPLEMENTATION_NAME ) == 0)
- {
- Reference< XSingleServiceFactory > xFactory( createSingleFactory(
- reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
- OUString::createFromAscii( pImplName ),
- connector_CreateInstance, connector_getSupportedServiceNames() ) );
-
- if (xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
-
- return pRet;
+ return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
}
+
}
diff --git a/io/source/connector/connector.hxx b/io/source/connector/connector.hxx
index 59789845fea7..d476729e0eec 100644
--- a/io/source/connector/connector.hxx
+++ b/io/source/connector/connector.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: connector.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jbu $ $Date: 2001-03-15 11:09:54 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -58,6 +58,7 @@
*
*
************************************************************************/
+#include <rtl/unload.h>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase2.hxx>
@@ -76,6 +77,8 @@
namespace stoc_connector
{
+ extern rtl_StandardModuleCount g_moduleCount;
+
template<class T>
struct ReferenceHash
{
@@ -106,6 +109,7 @@ namespace stoc_connector
{
public:
PipeConnection( const ::rtl::OUString & s, const ::rtl::OUString &sConnectionDescription );
+ virtual ~PipeConnection();
virtual sal_Int32 SAL_CALL read( ::com::sun::star::uno::Sequence< sal_Int8 >& aReadBytes,
sal_Int32 nBytesToRead )
@@ -134,6 +138,7 @@ namespace stoc_connector
{
public:
SocketConnection( const ::rtl::OUString & s , sal_uInt16 nPort, const ::rtl::OUString & sConnectionDescription );
+ virtual ~SocketConnection();
virtual sal_Int32 SAL_CALL read( ::com::sun::star::uno::Sequence< sal_Int8 >& aReadBytes,
sal_Int32 nBytesToRead )
diff --git a/io/source/connector/connectr.map b/io/source/connector/connectr.map
new file mode 100644
index 000000000000..f76809fbd37b
--- /dev/null
+++ b/io/source/connector/connectr.map
@@ -0,0 +1,10 @@
+UDK_3_0_0 {
+ global:
+ component_getImplementationEnvironment;
+ component_writeInfo;
+ component_getFactory;
+ component_canUnload;
+ component_getDescriptionFunc;
+ local:
+ *;
+};
diff --git a/io/source/connector/ctr_pipe.cxx b/io/source/connector/ctr_pipe.cxx
index 87ec8a5d8ee4..3b13cbc65814 100644
--- a/io/source/connector/ctr_pipe.cxx
+++ b/io/source/connector/ctr_pipe.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ctr_pipe.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jbu $ $Date: 2000-11-28 08:20:57 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,11 +74,17 @@ namespace stoc_connector {
m_nStatus( 0 ),
m_sDescription( sConnectionDescription )
{
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
// make it unique
m_sDescription += OUString::createFromAscii( ",uniqueValue=" );
m_sDescription += OUString::valueOf( (sal_Int64) &m_pipe , 10 );
}
+ PipeConnection::~PipeConnection()
+ {
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
+ }
+
sal_Int32 PipeConnection::read( Sequence < sal_Int8 > & aReadBytes , sal_Int32 nBytesToRead )
throw(::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException)
diff --git a/io/source/connector/ctr_socket.cxx b/io/source/connector/ctr_socket.cxx
index 6d26573f1649..1d3452b27a1b 100644
--- a/io/source/connector/ctr_socket.cxx
+++ b/io/source/connector/ctr_socket.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ctr_socket.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: jbu $ $Date: 2001-03-15 11:09:54 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -125,10 +125,16 @@ namespace stoc_connector {
_error(sal_False)
{
// make it unique
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
m_sDescription += OUString( RTL_CONSTASCII_USTRINGPARAM( ",uniqueValue=" ) );
m_sDescription += OUString::valueOf( (sal_Int64) &m_socket , 10 );
}
+ SocketConnection::~SocketConnection()
+ {
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
+ }
+
void SocketConnection::completeConnectionString()
{
sal_Int32 nPort;
diff --git a/io/source/connector/makefile.mk b/io/source/connector/makefile.mk
index 8b036aa862a5..daa64eaffc51 100644
--- a/io/source/connector/makefile.mk
+++ b/io/source/connector/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.8 $
+# $Revision: 1.9 $
#
-# last change: $Author: jbu $ $Date: 2001-03-15 11:09:54 $
+# last change: $Author: jbu $ $Date: 2001-06-22 16:32:56 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -87,6 +87,7 @@ SLOFILES= \
$(SLO)$/ctr_socket.obj
SHL1TARGET= $(TARGET)
+SHL1VERSIONMAP=$(TARGET).map
SHL1STDLIBS= \
$(SALLIB) \
@@ -99,7 +100,6 @@ SHL1LIBS= $(SLB)$/$(TARGET).lib
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
# --- Targets ------------------------------------------------------
diff --git a/io/source/stm/factreg.cxx b/io/source/stm/factreg.cxx
index 976df27ad1bb..8f28e7b570bd 100644
--- a/io/source/stm/factreg.cxx
+++ b/io/source/stm/factreg.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: factreg.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jl $ $Date: 2001-03-12 15:51:38 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,6 +61,7 @@
#include <osl/diagnose.h>
#include <cppuhelper/factory.hxx>
+#include <cppuhelper/implementationentry.hxx>
#include <com/sun/star/registry/XRegistryKey.hpp>
@@ -72,158 +73,84 @@ using namespace ::com::sun::star::registry;
#include "factreg.hxx"
+namespace io_stm
+{
+ rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
+}
+
using namespace io_stm;
+static struct ImplementationEntry g_entries[] =
+{
+ {
+ OPipeImpl_CreateInstance, OPipeImpl_getImplementationName ,
+ OPipeImpl_getSupportedServiceNames, createSingleComponentFactory ,
+ &g_moduleCount.modCnt , 0
+ },
+ {
+ OPumpImpl_CreateInstance, OPumpImpl_getImplementationName ,
+ OPumpImpl_getSupportedServiceNames, createSingleComponentFactory ,
+ &g_moduleCount.modCnt , 0
+ },
+ {
+ ODataInputStream_CreateInstance, ODataInputStream_getImplementationName,
+ ODataInputStream_getSupportedServiceNames, createSingleComponentFactory,
+ &g_moduleCount.modCnt, 0
+ },
+ {
+ ODataOutputStream_CreateInstance, ODataOutputStream_getImplementationName,
+ ODataOutputStream_getSupportedServiceNames, createSingleComponentFactory,
+ &g_moduleCount.modCnt, 0
+ },
+ {
+ OObjectInputStream_CreateInstance, OObjectInputStream_getImplementationName,
+ OObjectInputStream_getSupportedServiceNames, createSingleComponentFactory,
+ &g_moduleCount.modCnt, 0
+ },
+ {
+ OObjectOutputStream_CreateInstance, OObjectOutputStream_getImplementationName,
+ OObjectOutputStream_getSupportedServiceNames, createSingleComponentFactory,
+ &g_moduleCount.modCnt, 0
+ },
+ {
+ OMarkableInputStream_CreateInstance, OMarkableInputStream_getImplementationName,
+ OMarkableInputStream_getSupportedServiceNames, createSingleComponentFactory,
+ &g_moduleCount.modCnt, 0
+ },
+ {
+ OMarkableOutputStream_CreateInstance, OMarkableOutputStream_getImplementationName,
+ OMarkableOutputStream_getSupportedServiceNames, createSingleComponentFactory,
+ &g_moduleCount.modCnt, 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
+
+};
+
extern "C"
{
+sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
+{
+ return g_moduleCount.canUnload( &g_moduleCount , pTime );
+}
+//==================================================================================================
void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-
+//==================================================================================================
sal_Bool SAL_CALL component_writeInfo(
void * pServiceManager, void * pRegistryKey )
{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
-
- OUString str = OUString::createFromAscii( "/" );
- str += OPipeImpl_getImplementationName();
- str += OUString::createFromAscii( "/UNO/SERVICES" );
- Reference< XRegistryKey > xNewKey = xKey->createKey( str );
- xNewKey->createKey( OPipeImpl_getServiceName() );
-
- str = OUString::createFromAscii( "/" );
- str += ODataInputStream_getImplementationName();
- str += OUString::createFromAscii( "/UNO/SERVICES" );
- xNewKey = xKey->createKey( str );
- xNewKey->createKey( ODataInputStream_getServiceName() );
-
- str = OUString::createFromAscii( "/" );
- str += ODataOutputStream_getImplementationName();
- str += OUString::createFromAscii( "/UNO/SERVICES" );
- xNewKey = xKey->createKey( str );
- xNewKey->createKey( ODataOutputStream_getServiceName() );
-
- str = OUString::createFromAscii( "/" );
- str += OMarkableOutputStream_getImplementationName();
- str += OUString::createFromAscii( "/UNO/SERVICES" );
- xNewKey = xKey->createKey( str );
- xNewKey->createKey( OMarkableOutputStream_getServiceName() );
-
- str = OUString::createFromAscii( "/" );
- str += OMarkableInputStream_getImplementationName();
- str += OUString::createFromAscii( "/UNO/SERVICES" );
- xNewKey = xKey->createKey( str );
- xNewKey->createKey( OMarkableInputStream_getServiceName() );
-
- str = OUString::createFromAscii( "/" );
- str += OObjectInputStream_getImplementationName();
- str += OUString::createFromAscii( "/UNO/SERVICES" );
- xNewKey = xKey->createKey( str );
- xNewKey->createKey( OObjectInputStream_getServiceName() );
-
- str = OUString::createFromAscii( "/" );
- str += OObjectOutputStream_getImplementationName();
- str += OUString::createFromAscii( "/UNO/SERVICES" );
- xNewKey = xKey->createKey( str );
- xNewKey->createKey( OObjectOutputStream_getServiceName() );
-
- str = OUString::createFromAscii( "/" );
- str += OPumpImpl_getImplementationName();
- str += OUString::createFromAscii( "/UNO/SERVICES" );
- xNewKey = xKey->createKey( str );
- xNewKey->createKey( OPumpImpl_getServiceName() );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
+ return component_writeInfoHelper( pServiceManager, pRegistryKey, g_entries );
}
-
-
-// createSingleFactory(
-// reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
-// OUString::createFromAscii( pImplName ),
-// acceptor_CreateInstance, acceptor_getSupportedServiceNames() ) );
-
+//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
- void * pRet = 0;
-
- if (pServiceManager )
- {
- Reference< XSingleServiceFactory > xRet;
- Reference< XMultiServiceFactory > xSMgr =
- reinterpret_cast< XMultiServiceFactory * > ( pServiceManager );
-
- OUString aImplementationName = OUString::createFromAscii( pImplName );
-
- if (aImplementationName == OPipeImpl_getImplementationName() )
- {
- xRet = createSingleFactory( xSMgr, aImplementationName,
- OPipeImpl_CreateInstance,
- OPipeImpl_getSupportedServiceNames() );
- }
- else if( aImplementationName == ODataInputStream_getImplementationName() ) {
- xRet = createSingleFactory( xSMgr , aImplementationName,
- ODataInputStream_CreateInstance,
- ODataInputStream_getSupportedServiceNames() );
- }
- else if( aImplementationName == ODataOutputStream_getImplementationName() ) {
- xRet = createSingleFactory( xSMgr , aImplementationName,
- ODataOutputStream_CreateInstance,
- ODataOutputStream_getSupportedServiceNames() );
- }
- else if( aImplementationName == OMarkableOutputStream_getImplementationName() ) {
- xRet = createSingleFactory( xSMgr , aImplementationName,
- OMarkableOutputStream_CreateInstance,
- OMarkableOutputStream_getSupportedServiceNames() );
- }
- else if( aImplementationName == OMarkableInputStream_getImplementationName() ) {
- xRet = createSingleFactory( xSMgr , aImplementationName,
- OMarkableInputStream_CreateInstance,
- OMarkableInputStream_getSupportedServiceNames() );
- }
- else if( aImplementationName == OObjectInputStream_getImplementationName() ) {
- xRet = createSingleFactory( xSMgr , aImplementationName,
- OObjectInputStream_CreateInstance,
- OObjectInputStream_getSupportedServiceNames() );
- }
- else if( aImplementationName == OObjectOutputStream_getImplementationName() ) {
- xRet = createSingleFactory( xSMgr , aImplementationName,
- OObjectOutputStream_CreateInstance,
- OObjectOutputStream_getSupportedServiceNames() );
- }
- else if( aImplementationName == OPumpImpl_getImplementationName() ) {
- xRet = createSingleFactory( xSMgr , aImplementationName,
- OPumpImpl_CreateInstance,
- OPumpImpl_getSupportedServiceNames() );
- }
-
- if (xRet.is())
- {
- xRet->acquire();
- pRet = xRet.get();
- }
- }
-
- return pRet;
+ return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
}
-
-
}
diff --git a/io/source/stm/factreg.hxx b/io/source/stm/factreg.hxx
index bfced90b53fb..716f94d55cc1 100644
--- a/io/source/stm/factreg.hxx
+++ b/io/source/stm/factreg.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: factreg.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:24:18 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -58,47 +58,44 @@
*
*
************************************************************************/
+#ifndef _RTL_UNLOAD_H_
+#include <rtl/unload.h>
+#endif
namespace io_stm {
+extern rtl_StandardModuleCount g_moduleCount;
+
// OPipeImpl
-Reference< XInterface > SAL_CALL OPipeImpl_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw (Exception);
-OUString OPipeImpl_getServiceName();
+Reference< XInterface > SAL_CALL OPipeImpl_CreateInstance( const Reference< XComponentContext > & rSMgr ) throw (Exception);
OUString OPipeImpl_getImplementationName();
Sequence<OUString> OPipeImpl_getSupportedServiceNames(void);
-Reference< XInterface > SAL_CALL ODataInputStream_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw (Exception);
-OUString ODataInputStream_getServiceName();
+Reference< XInterface > SAL_CALL ODataInputStream_CreateInstance( const Reference< XComponentContext > & rSMgr ) throw (Exception);
OUString ODataInputStream_getImplementationName();
Sequence<OUString> ODataInputStream_getSupportedServiceNames(void);
-Reference< XInterface > SAL_CALL ODataOutputStream_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw (Exception);
-OUString ODataOutputStream_getServiceName();
+Reference< XInterface > SAL_CALL ODataOutputStream_CreateInstance( const Reference< XComponentContext > & rSMgr ) throw (Exception);
OUString ODataOutputStream_getImplementationName();
Sequence<OUString> ODataOutputStream_getSupportedServiceNames(void);
-Reference< XInterface > SAL_CALL OMarkableOutputStream_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw (Exception);
-OUString OMarkableOutputStream_getServiceName();
+Reference< XInterface > SAL_CALL OMarkableOutputStream_CreateInstance( const Reference< XComponentContext > & rSMgr ) throw (Exception);
OUString OMarkableOutputStream_getImplementationName();
Sequence<OUString> OMarkableOutputStream_getSupportedServiceNames(void);
-Reference< XInterface > SAL_CALL OMarkableInputStream_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw (Exception);
-OUString OMarkableInputStream_getServiceName();
+Reference< XInterface > SAL_CALL OMarkableInputStream_CreateInstance( const Reference< XComponentContext > & rSMgr ) throw (Exception);
OUString OMarkableInputStream_getImplementationName() ;
Sequence<OUString> OMarkableInputStream_getSupportedServiceNames(void);
-Reference< XInterface > SAL_CALL OObjectOutputStream_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
-OUString OObjectOutputStream_getServiceName();
+Reference< XInterface > SAL_CALL OObjectOutputStream_CreateInstance( const Reference< XComponentContext > & rSMgr ) throw(Exception);
OUString OObjectOutputStream_getImplementationName();
Sequence<OUString> OObjectOutputStream_getSupportedServiceNames(void);
-Reference< XInterface > SAL_CALL OObjectInputStream_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
-OUString OObjectInputStream_getServiceName();
+Reference< XInterface > SAL_CALL OObjectInputStream_CreateInstance( const Reference< XComponentContext > & rSMgr ) throw(Exception);
OUString OObjectInputStream_getImplementationName() ;
Sequence<OUString> OObjectInputStream_getSupportedServiceNames(void);
-Reference< XInterface > SAL_CALL OPumpImpl_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw (Exception);
-OUString OPumpImpl_getServiceName();
+Reference< XInterface > SAL_CALL OPumpImpl_CreateInstance( const Reference< XComponentContext > & rSMgr ) throw (Exception);
OUString OPumpImpl_getImplementationName();
Sequence<OUString> OPumpImpl_getSupportedServiceNames(void);
diff --git a/io/source/stm/makefile.mk b/io/source/stm/makefile.mk
index cef1ffeb2f8e..53ce55703514 100644
--- a/io/source/stm/makefile.mk
+++ b/io/source/stm/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.7 $
+# $Revision: 1.8 $
#
-# last change: $Author: pluby $ $Date: 2001-03-02 07:15:46 $
+# last change: $Author: jbu $ $Date: 2001-06-22 16:32:57 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -87,6 +87,7 @@ SLOFILES = $(SLO)$/opipe.obj\
$(SLO)$/opump.obj
SHL1TARGET= $(TARGET)
+SHL1VERSIONMAP= $(TARGET).map
SHL1STDLIBS= \
$(SALLIB) \
@@ -100,7 +101,6 @@ SHL1LIBS= $(SLB)$/$(TARGET).lib
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
# --- Targets ------------------------------------------------------
diff --git a/io/source/stm/odata.cxx b/io/source/stm/odata.cxx
index 6e92d05d83b8..e47aca1150dc 100644
--- a/io/source/stm/odata.cxx
+++ b/io/source/stm/odata.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: odata.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: tbe $ $Date: 2001-05-11 09:48:01 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -107,11 +107,13 @@ class ODataInputStream :
>
{
public:
- ODataInputStream( const Reference< XMultiServiceFactory > &r ) :
- m_bValidStream( sal_False ),
- m_rFactory( r )
- {}
+ ODataInputStream( )
+ : m_bValidStream( sal_False )
+ {
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
+ }
+ ~ODataInputStream();
public: // XInputStream
virtual sal_Int32 SAL_CALL readBytes(Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead)
throw ( NotConnectedException,
@@ -160,15 +162,18 @@ public: // XServiceInfo
sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw ();
protected:
- Reference < XMultiServiceFactory > m_rFactory;
Reference < XConnectable > m_pred;
Reference < XConnectable > m_succ;
-
Reference < XInputStream > m_input;
sal_Bool m_bValidStream;
};
+ODataInputStream::~ODataInputStream()
+{
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
+}
+
// XInputStream
sal_Int32 ODataInputStream::readBytes(Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead)
throw ( NotConnectedException,
@@ -521,14 +526,9 @@ sal_Bool ODataInputStream::supportsService(const OUString& ServiceName) throw ()
// XServiceInfo
Sequence< OUString > ODataInputStream::getSupportedServiceNames(void) throw ()
{
- Sequence<OUString> seq(1);
- seq.getArray()[0] = ODataInputStream_getServiceName();
- return seq;
+ return ODataInputStream_getSupportedServiceNames();
}
-
-
-
/***
*
* registration information
@@ -536,29 +536,21 @@ Sequence< OUString > ODataInputStream::getSupportedServiceNames(void) throw ()
*
****/
-Reference< XInterface > SAL_CALL ODataInputStream_CreateInstance( const Reference < XMultiServiceFactory > & rSMgr ) throw( Exception)
+Reference< XInterface > SAL_CALL ODataInputStream_CreateInstance( const Reference < XComponentContext > & rSMgr ) throw( Exception)
{
- ODataInputStream *p = new ODataInputStream( rSMgr );
+ ODataInputStream *p = new ODataInputStream;
return Reference< XInterface > ( (OWeakObject * ) p );
}
-
-OUString ODataInputStream_getServiceName()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.DataInputStream" ) );
-}
-
OUString ODataInputStream_getImplementationName()
{
- return OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.io.stm.DataInputStream" ) );
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.io.stm.DataInputStream" ) );
}
Sequence<OUString> ODataInputStream_getSupportedServiceNames(void)
{
Sequence<OUString> aRet(1);
- aRet.getArray()[0] = ODataInputStream_getServiceName();
-
+ aRet.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.DataInputStream" ) );
return aRet;
}
@@ -573,10 +565,12 @@ class ODataOutputStream :
XServiceInfo >
{
public:
- ODataOutputStream( const Reference< XMultiServiceFactory > &r) :
- m_rFactory(r),
- m_bValidStream( sal_False )
- {}
+ ODataOutputStream()
+ : m_bValidStream( sal_False )
+ {
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
+ }
+ ~ODataOutputStream();
public: // XOutputStream
virtual void SAL_CALL writeBytes(const Sequence< sal_Int8 >& aData)
@@ -624,14 +618,16 @@ public: // XServiceInfo
sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw ();
protected:
- Reference < XMultiServiceFactory > m_rFactory;
Reference < XConnectable > m_succ;
Reference < XConnectable > m_pred;
-
-Reference< XOutputStream > m_output;
+ Reference< XOutputStream > m_output;
sal_Bool m_bValidStream;
};
+ODataOutputStream::~ODataOutputStream()
+{
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
+}
// XOutputStream
@@ -940,37 +936,29 @@ sal_Bool ODataOutputStream::supportsService(const OUString& ServiceName) throw (
// XServiceInfo
Sequence< OUString > ODataOutputStream::getSupportedServiceNames(void) throw ()
{
-
- Sequence<OUString> seq(1);
- seq.getArray()[0] = ODataOutputStream_getServiceName();
- return seq;
+ return ODataOutputStream_getSupportedServiceNames();
}
-Reference< XInterface > SAL_CALL ODataOutputStream_CreateInstance( const Reference < XMultiServiceFactory > & rSMgr ) throw(Exception)
+Reference< XInterface > SAL_CALL ODataOutputStream_CreateInstance( const Reference < XComponentContext > & rSMgr ) throw(Exception)
{
- ODataOutputStream *p = new ODataOutputStream( rSMgr );
+ ODataOutputStream *p = new ODataOutputStream;
Reference< XInterface > xService = *p;
return xService;
}
-OUString ODataOutputStream_getServiceName()
-{
- return OUString::createFromAscii( "com.sun.star.io.DataOutputStream" );
-}
OUString ODataOutputStream_getImplementationName()
{
- return OUString::createFromAscii( "com.sun.star.comp.io.stm.DataOutputStream" );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.io.stm.DataOutputStream" ) );
}
Sequence<OUString> ODataOutputStream_getSupportedServiceNames(void)
{
Sequence<OUString> aRet(1);
- aRet.getArray()[0] = ODataOutputStream_getServiceName();
-
+ aRet.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.DataOutputStream" ) );
return aRet;
}
@@ -1001,38 +989,6 @@ typedef hash_map
equalObjectContainer_Impl
> ObjectContainer_Impl;
-//------------------------------
-//------------------------------
-//------------------------------
-// struct equalXPersistObjectRef_Impl
-// {
-// sal_Int32 operator()(const Reference< XPersistObject > & s1, c
-// const Reference< XPersistObject > & s2) const
-// {
-// return s1 == s2;
-// }
-// };
-
-// //-----------------------------------------------------------------------------
-// struct hashXPersistObjectRef_Impl
-// {
-// size_t operator()(const Reference< XPersistObject > & xRef) const
-// {
-// return (size_t)(XInterface *)xRef;
-// }
-// };
-
-
-// typedef NAMESPACE_STD(hash_map)
-// <
-// XPersistObjectRef,
-// sal_Int32,
-// hashXPersistObjectRef_Impl,
-// equalXPersistObjectRef_Impl
-// > XPersistObjectRefHashMap_Impl;
-
-/**
- */
/*---------------------------------------------
*
*
@@ -1045,8 +1001,14 @@ class OObjectOutputStream :
public XMarkableStream
{
public:
- OObjectOutputStream( const Reference < XMultiServiceFactory > &r ) :
- ODataOutputStream(r) , m_nMaxId(0) , m_bValidMarkable(sal_False) {}
+ OObjectOutputStream()
+ : m_nMaxId(0) ,
+ m_bValidMarkable(sal_False)
+ {
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
+ }
+
+ ~OObjectOutputStream();
public:
Any SAL_CALL queryInterface( const Type &type );
@@ -1125,6 +1087,10 @@ private:
sal_Bool m_bValidMarkable;
};
+OObjectOutputStream::~OObjectOutputStream()
+{
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
+}
Any OObjectOutputStream::queryInterface( const Type &aType )
{
@@ -1285,18 +1251,13 @@ sal_Int32 OObjectOutputStream::offsetToMark(sal_Int32 nMark)
-Reference< XInterface > SAL_CALL OObjectOutputStream_CreateInstance( const Reference < XMultiServiceFactory > & rSMgr )
+Reference< XInterface > SAL_CALL OObjectOutputStream_CreateInstance( const Reference < XComponentContext > & rCtx )
throw(Exception)
{
- OObjectOutputStream *p = new OObjectOutputStream( rSMgr );
+ OObjectOutputStream *p = new OObjectOutputStream;
return Reference< XInterface > ( SAL_STATIC_CAST( OWeakObject * , p ) );
}
-OUString OObjectOutputStream_getServiceName()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.ObjectOutputStream" ) );
-}
-
OUString OObjectOutputStream_getImplementationName()
{
return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.io.stm.ObjectOutputStream" ) );
@@ -1305,7 +1266,7 @@ OUString OObjectOutputStream_getImplementationName()
Sequence<OUString> OObjectOutputStream_getSupportedServiceNames(void)
{
Sequence<OUString> aRet(1);
- aRet.getArray()[0] = OObjectOutputStream_getServiceName();
+ aRet.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.ObjectOutputStream" ) );
return aRet;
}
@@ -1365,9 +1326,7 @@ sal_Bool OObjectOutputStream::supportsService(const OUString& ServiceName) throw
// XServiceInfo
Sequence< OUString > OObjectOutputStream::getSupportedServiceNames(void) throw ()
{
- Sequence<OUString> seq(1);
- seq.getArray()[0] = OObjectOutputStream_getServiceName();
- return seq;
+ return OObjectOutputStream_getSupportedServiceNames();
}
@@ -1380,10 +1339,15 @@ class OObjectInputStream :
public XMarkableStream
{
public:
- OObjectInputStream( const Reference < XMultiServiceFactory > &r) :
- ODataInputStream(r),
- m_bValidMarkable(sal_False)
- {}
+ OObjectInputStream( const Reference < XComponentContext > &r)
+ : m_bValidMarkable(sal_False)
+ , m_rCxt( r )
+ , m_rSMgr( r->getServiceManager() )
+ {
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
+ }
+ ~OObjectInputStream();
+
public:
Any SAL_CALL queryInterface( const Type &type );
void SAL_CALL acquire() { ODataInputStream::acquire(); }
@@ -1464,12 +1428,18 @@ public: // XServiceInfo
private:
void connectToMarkable();
private:
+ Reference < XMultiComponentFactory > m_rSMgr;
+ Reference < XComponentContext > m_rCxt;
sal_Bool m_bValidMarkable;
Reference < XMarkableStream > m_rMarkable;
vector < Reference< XPersistObject > > m_aPersistVector;
};
+OObjectInputStream::~OObjectInputStream()
+{
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
+}
Any OObjectInputStream::queryInterface( const Type &aType )
{
@@ -1525,7 +1495,7 @@ Reference< XPersistObject > OObjectInputStream::readObject()
if( aName.getLength() )
{
// load the object
- Reference< XInterface > x = m_rFactory->createInstance( aName );
+ Reference< XInterface > x = m_rSMgr->createInstanceWithContext( aName, m_rCxt );
xLoadedObj = Reference< XPersistObject >( x, UNO_QUERY );
if( xLoadedObj.is() )
{
@@ -1698,36 +1668,27 @@ sal_Bool OObjectInputStream::supportsService(const OUString& ServiceName) throw
// XServiceInfo
Sequence< OUString > OObjectInputStream::getSupportedServiceNames(void) throw ()
{
- Sequence<OUString> seq(1);
- seq.getArray()[0] = OObjectInputStream_getServiceName();
- return seq;
+ return OObjectInputStream_getSupportedServiceNames();
}
-Reference< XInterface > SAL_CALL OObjectInputStream_CreateInstance( const Reference < XMultiServiceFactory > & rSMgr ) throw(Exception)
+Reference< XInterface > SAL_CALL OObjectInputStream_CreateInstance( const Reference < XComponentContext > & rCtx ) throw(Exception)
{
- OObjectInputStream *p = new OObjectInputStream( rSMgr );
- return Reference< XInterface> (
- SAL_STATIC_CAST( OWeakObject *, p ) );
-}
-
-OUString OObjectInputStream_getServiceName()
-{
- return OUString::createFromAscii( "com.sun.star.io.ObjectInputStream" );
+ OObjectInputStream *p = new OObjectInputStream( rCtx );
+ return Reference< XInterface> ( SAL_STATIC_CAST( OWeakObject *, p ) );
}
OUString OObjectInputStream_getImplementationName()
{
- return OUString::createFromAscii( "com.sun.star.comp.io.stm.ObjectInputStream" );
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.io.stm.ObjectInputStream" ) );
}
Sequence<OUString> OObjectInputStream_getSupportedServiceNames(void)
{
Sequence<OUString> aRet(1);
- aRet.getArray()[0] = OObjectInputStream_getServiceName();
-
+ aRet.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.ObjectInputStream" ) );
return aRet;
}
diff --git a/io/source/stm/omark.cxx b/io/source/stm/omark.cxx
index ea34eb7b97f7..9289c93de5b5 100644
--- a/io/source/stm/omark.cxx
+++ b/io/source/stm/omark.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: omark.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:24:18 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -188,6 +188,7 @@ private:
OMarkableOutputStream::OMarkableOutputStream( )
{
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
m_pBuffer = new MemRingBuffer;
m_nCurrentPos = 0;
m_nCurrentMark = 0;
@@ -197,6 +198,7 @@ OMarkableOutputStream::~OMarkableOutputStream()
{
m_nCurrentMark;
delete m_pBuffer;
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
}
@@ -460,10 +462,7 @@ sal_Bool OMarkableOutputStream::supportsService(const OUString& ServiceName) thr
// XServiceInfo
Sequence< OUString > OMarkableOutputStream::getSupportedServiceNames(void) throw ()
{
-
- Sequence<OUString> seq(1);
- seq.getArray()[0] = OMarkableOutputStream_getServiceName();
- return seq;
+ return OMarkableOutputStream_getSupportedServiceNames();
}
@@ -474,18 +473,13 @@ Sequence< OUString > OMarkableOutputStream::getSupportedServiceNames(void) throw
* external binding
*
*------------------------*/
-Reference< XInterface > SAL_CALL OMarkableOutputStream_CreateInstance( const Reference < XMultiServiceFactory > & ) throw(Exception)
+Reference< XInterface > SAL_CALL OMarkableOutputStream_CreateInstance( const Reference < XComponentContext > & ) throw(Exception)
{
OMarkableOutputStream *p = new OMarkableOutputStream( );
return Reference < XInterface > ( ( OWeakObject * ) p );
}
-OUString OMarkableOutputStream_getServiceName()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.MarkableOutputStream" ) );
-}
-
OUString OMarkableOutputStream_getImplementationName()
{
return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.io.stm.MarkableOutputStream" ));
@@ -494,7 +488,7 @@ OUString OMarkableOutputStream_getImplementationName()
Sequence<OUString> OMarkableOutputStream_getSupportedServiceNames(void)
{
Sequence<OUString> aRet(1);
- aRet.getArray()[0] = OMarkableOutputStream_getServiceName();
+ aRet.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.MarkableOutputStream" ) );
return aRet;
}
@@ -595,6 +589,7 @@ private:
OMarkableInputStream::OMarkableInputStream()
{
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
m_nCurrentPos = 0;
m_nCurrentMark = 0;
m_pBuffer = new MemRingBuffer;
@@ -606,6 +601,7 @@ OMarkableInputStream::~OMarkableInputStream()
if( m_pBuffer ) {
delete m_pBuffer;
}
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
}
@@ -975,10 +971,7 @@ sal_Bool OMarkableInputStream::supportsService(const OUString& ServiceName) thro
// XServiceInfo
Sequence< OUString > OMarkableInputStream::getSupportedServiceNames(void) throw ()
{
-
- Sequence<OUString> seq(1);
- seq.getArray()[0] = OMarkableInputStream_getServiceName();
- return seq;
+ return OMarkableInputStream_getSupportedServiceNames();
}
@@ -988,27 +981,21 @@ Sequence< OUString > OMarkableInputStream::getSupportedServiceNames(void) throw
*
*------------------------*/
Reference < XInterface > SAL_CALL OMarkableInputStream_CreateInstance(
- const Reference < XMultiServiceFactory > & rSMgr ) throw(Exception)
+ const Reference < XComponentContext > & rSMgr ) throw(Exception)
{
OMarkableInputStream *p = new OMarkableInputStream( );
return Reference< XInterface > ( (OWeakObject * ) p );
}
-OUString OMarkableInputStream_getServiceName()
-{
- return OUString::createFromAscii( "com.sun.star.io.MarkableInputStream" );
-}
-
OUString OMarkableInputStream_getImplementationName()
{
- return OUString::createFromAscii( "com.sun.star.comp.io.stm.MarkableInputStream" );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.io.stm.MarkableInputStream" ));
}
Sequence<OUString> OMarkableInputStream_getSupportedServiceNames(void)
{
Sequence<OUString> aRet(1);
- aRet.getArray()[0] = OMarkableInputStream_getServiceName();
-
+ aRet.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.MarkableInputStream" ));
return aRet;
}
diff --git a/io/source/stm/opipe.cxx b/io/source/stm/opipe.cxx
index a3ba15cdd7d3..f359bbc4c7d9 100644
--- a/io/source/stm/opipe.cxx
+++ b/io/source/stm/opipe.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: opipe.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:24:18 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -174,6 +174,7 @@ private:
OPipeImpl::OPipeImpl()
{
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
m_nBytesToSkip = 0;
m_bOutputStreamClosed = sal_False;
@@ -187,6 +188,7 @@ OPipeImpl::~OPipeImpl()
{
osl_destroyCondition( m_conditionBytesAvail );
delete m_pFIFO;
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
}
@@ -462,9 +464,7 @@ sal_Bool OPipeImpl::supportsService(const OUString& ServiceName) throw( )
// XServiceInfo
Sequence< OUString > OPipeImpl::getSupportedServiceNames(void) throw( )
{
- Sequence<OUString> seq(1);
- seq.getArray()[0] = OPipeImpl_getServiceName();
- return seq;
+ return OPipeImpl_getSupportedServiceNames();
}
@@ -478,7 +478,7 @@ Sequence< OUString > OPipeImpl::getSupportedServiceNames(void) throw( )
Reference < XInterface > SAL_CALL OPipeImpl_CreateInstance(
- const Reference < XMultiServiceFactory > & rSMgr ) throw(Exception)
+ const Reference < XComponentContext > & rCtx ) throw(Exception)
{
OPipeImpl *p = new OPipeImpl;
@@ -486,21 +486,15 @@ Reference < XInterface > SAL_CALL OPipeImpl_CreateInstance(
}
-OUString OPipeImpl_getServiceName()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
-}
-
OUString OPipeImpl_getImplementationName()
{
- return OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
+ return OUString( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
}
Sequence<OUString> OPipeImpl_getSupportedServiceNames(void)
{
Sequence<OUString> aRet(1);
- aRet.getArray()[0] = OPipeImpl_getServiceName();
-
+ aRet.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME ));
return aRet;
}
}
diff --git a/io/source/stm/opump.cxx b/io/source/stm/opump.cxx
index 0aa278f74ec8..80c7e5539dab 100644
--- a/io/source/stm/opump.cxx
+++ b/io/source/stm/opump.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: opump.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jbu $ $Date: 2001-06-08 15:57:18 $
+ * last change: $Author: jbu $ $Date: 2001-06-22 16:32:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -145,6 +145,7 @@ namespace io_stm {
Pump::Pump()
: m_aThread( NULL )
{
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
}
Pump::~Pump()
@@ -152,6 +153,7 @@ Pump::~Pump()
// exit gracefully
osl_joinWithThread( m_aThread );
osl_destroyThread( m_aThread );
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
}
void Pump::fireError( list< Reference< XStreamListener > > &aList , Any & exception )
@@ -475,16 +477,11 @@ Sequence< OUString > Pump::getSupportedServiceNames(void) throw( )
}
-Reference< XInterface > SAL_CALL OPumpImpl_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw (Exception)
+Reference< XInterface > SAL_CALL OPumpImpl_CreateInstance( const Reference< XComponentContext > & rSMgr ) throw (Exception)
{
return Reference< XInterface >( *new Pump );
}
-OUString OPumpImpl_getServiceName()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.Pump" ) );
-}
-
OUString OPumpImpl_getImplementationName()
{
return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.io.Pump") );
@@ -492,7 +489,7 @@ OUString OPumpImpl_getImplementationName()
Sequence<OUString> OPumpImpl_getSupportedServiceNames(void)
{
- OUString s = OPumpImpl_getServiceName();
+ OUString s( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.Pump" ) );
Sequence< OUString > seq( &s , 1 );
return seq;
}
diff --git a/io/source/stm/stm.map b/io/source/stm/stm.map
new file mode 100644
index 000000000000..f76809fbd37b
--- /dev/null
+++ b/io/source/stm/stm.map
@@ -0,0 +1,10 @@
+UDK_3_0_0 {
+ global:
+ component_getImplementationEnvironment;
+ component_writeInfo;
+ component_getFactory;
+ component_canUnload;
+ component_getDescriptionFunc;
+ local:
+ *;
+};