Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_TSS_Connection Class Reference

Class for providing a connection per thread. More...

#include <Remote_Tokens.h>

Inheritance diagram for ACE_TSS_Connection:

Inheritance graph
[legend]
Collaboration diagram for ACE_TSS_Connection:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_TSS_Connection (void)
 ~ACE_TSS_Connection (void)
ACE_SOCK_Streamget_connection (void)
 Retrieve the thread's connection. More...

virtual ACE_SOCK_Streammake_TSS_TYPE (void) const
 Factory Method that creates a new SOCK Stream. More...

 operator ACE_SOCK_Stream * (void)
 Inheritence and operator overloading don't mix. Redefine this from ACE_TSS so that we can use it. More...

void dump (void) const
 Dump the state of the class. More...


Static Public Methods

void set_server_address (const ACE_INET_Addr &server_address)
 Set the server address. More...


Static Protected Attributes

ACE_INET_Addr server_address_
 The address of the Token Server used by all instances of Token_Proxy. More...


Private Methods

 ACE_TSS_Connection (const ACE_TSS_Connection &)
 Private: should not be used. More...

void operator= (const ACE_TSS_Connection &)

Detailed Description

Class for providing a connection per thread.

ACE_TSS_Connection provides a single access point for all threads to access thread-specific connections. This prevents resource-sharing problems such as thread serialization.

Definition at line 275 of file Remote_Tokens.h.


Constructor & Destructor Documentation

ACE_TSS_Connection::ACE_TSS_Connection void   
 

Definition at line 38 of file Remote_Tokens.cpp.

References ACE_TRACE.

00039 {
00040   ACE_TRACE ("ACE_TSS_Connection::ACE_TSS_Connection");
00041 }

ACE_TSS_Connection::~ACE_TSS_Connection void   
 

Definition at line 43 of file Remote_Tokens.cpp.

References ACE_TRACE.

00044 {
00045   ACE_TRACE ("ACE_TSS_Connection::~ACE_TSS_Connection");
00046 }

ACE_TSS_Connection::ACE_TSS_Connection const ACE_TSS_Connection &    [private]
 

Private: should not be used.


Member Function Documentation

void ACE_TSS_Connection::dump void    const
 

Dump the state of the class.

Reimplemented from ACE_TSS< ACE_SOCK_Stream >.

Definition at line 83 of file Remote_Tokens.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, ACE_TSS::dump, ACE_INET_Addr::dump, LM_DEBUG, and server_address_.

00084 {
00085   ACE_TRACE ("ACE_TSS_Connection::dump");
00086   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00087   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("ACE_TSS_Connection::dump:\n")));
00088   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("server_address_\n")));
00089   server_address_.dump ();
00090   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("base:\n")));
00091   ACE_TSS<ACE_SOCK_Stream>::dump ();
00092   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00093 }

ACE_SOCK_Stream * ACE_TSS_Connection::get_connection void   
 

Retrieve the thread's connection.

Definition at line 49 of file Remote_Tokens.cpp.

References ACE_TSS::operator->.

Referenced by operator ACE_SOCK_Stream *.

00050 {
00051   return ACE_TSS<ACE_SOCK_Stream>::operator-> ();
00052 }

ACE_SOCK_Stream * ACE_TSS_Connection::make_TSS_TYPE void    const [virtual]
 

Factory Method that creates a new SOCK Stream.

Reimplemented from ACE_TSS< ACE_SOCK_Stream >.

Definition at line 55 of file Remote_Tokens.cpp.

References ACE_DEBUG, ACE_LIB_TEXT, ACE_NEW_RETURN, ACE_TRACE, ACE_SOCK_Connector::connect, ECONNREFUSED, LM_DEBUG, and server_address_.

00056 {
00057   ACE_TRACE ("ACE_TSS_Connection::make_TSS_TYPE");
00058 
00059   ACE_SOCK_Connector connector;
00060   ACE_SOCK_Stream *stream = 0;
00061 
00062   ACE_NEW_RETURN (stream,
00063                   ACE_SOCK_Stream,
00064                   0);
00065 
00066   if (connector.connect (*stream, server_address_) == -1)
00067     {
00068       delete stream;
00069       errno = ECONNREFUSED;
00070       return 0;
00071     }
00072 
00073   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("ACE_TSS_Connection new connection\n")));
00074   return stream;
00075 }

ACE_TSS_Connection::operator ACE_SOCK_Stream * void   
 

Inheritence and operator overloading don't mix. Redefine this from ACE_TSS so that we can use it.

Definition at line 77 of file Remote_Tokens.cpp.

References get_connection.

00078 {
00079   return this->get_connection ();
00080 }

void ACE_TSS_Connection::operator= const ACE_TSS_Connection &    [private]
 

void ACE_TSS_Connection::set_server_address const ACE_INET_Addr   server_address [static]
 

Set the server address.

Definition at line 31 of file Remote_Tokens.cpp.

References ACE_TRACE, and server_address_.

00032 {
00033   ACE_TRACE ("ACE_TSS_Connection::set_server_address");
00034   server_address_ = server_address;
00035 }


Member Data Documentation

ACE_INET_Addr ACE_TSS_Connection::server_address_ [static, protected]
 

The address of the Token Server used by all instances of Token_Proxy.

Definition at line 26 of file Remote_Tokens.cpp.

Referenced by dump, make_TSS_TYPE, and set_server_address.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:58:43 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002