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 Member Functions

 ACE_TSS_Connection (void)
 ~ACE_TSS_Connection (void)
ACE_SOCK_Streamget_connection (void)
 Retrieve the thread's connection.
virtual ACE_SOCK_Streammake_TSS_TYPE (void) const
 Factory Method that creates a new SOCK Stream.
 operator ACE_SOCK_Stream * (void)
void dump (void) const
 Dump the state of the class.

Static Public Member Functions

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

Static Protected Attributes

static ACE_INET_Addr server_address_

Private Member Functions

 ACE_TSS_Connection (const ACE_TSS_Connection &)
 Private: should not be used.
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 278 of file Remote_Tokens.h.


Constructor & Destructor Documentation

ACE_TSS_Connection::ACE_TSS_Connection ( void   ) 

Definition at line 43 of file Remote_Tokens.cpp.

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

ACE_TSS_Connection::~ACE_TSS_Connection ( void   ) 

Definition at line 48 of file Remote_Tokens.cpp.

00049 {
00050   ACE_TRACE ("ACE_TSS_Connection::~ACE_TSS_Connection");
00051 }

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 88 of file Remote_Tokens.cpp.

00089 {
00090 #if defined (ACE_HAS_DUMP)
00091   ACE_TRACE ("ACE_TSS_Connection::dump");
00092   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00093   ACE_DEBUG ((LM_DEBUG,  ACE_TEXT ("ACE_TSS_Connection::dump:\n")));
00094   ACE_DEBUG ((LM_DEBUG,  ACE_TEXT ("server_address_\n")));
00095   server_address_.dump ();
00096   ACE_DEBUG ((LM_DEBUG,  ACE_TEXT ("base:\n")));
00097   ACE_TSS<ACE_SOCK_Stream>::dump ();
00098   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00099 #endif /* ACE_HAS_DUMP */
00100 }

ACE_SOCK_Stream * ACE_TSS_Connection::get_connection ( void   ) 

Retrieve the thread's connection.

Definition at line 54 of file Remote_Tokens.cpp.

00055 {
00056   return ACE_TSS<ACE_SOCK_Stream>::operator-> ();
00057 }

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 60 of file Remote_Tokens.cpp.

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

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 82 of file Remote_Tokens.cpp.

00083 {
00084   return this->get_connection ();
00085 }

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 36 of file Remote_Tokens.cpp.

00037 {
00038   ACE_TRACE ("ACE_TSS_Connection::set_server_address");
00039   server_address_ = server_address;
00040 }


Member Data Documentation

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

Definition at line 304 of file Remote_Tokens.h.


The documentation for this class was generated from the following files:

Generated on Fri Jul 3 23:25:30 2009 for ACE by  doxygen 1.5.8