channel::RemoteInterface< Channel, Transport > Class Template Reference

#include <Interface.h>

Inheritance diagram for channel::RemoteInterface< Channel, Transport >:

channel::Interface< Channel > List of all members.

Public Types

typedef Channel::IdType IdType
typedef Channel::IdTrait IdTrait
typedef Channel::Msg Msg
typedef Channel::Source Source
typedef Channel::Destination Destination
typedef Channel::Channel_Info_Msg Channel_Info_Msg
typedef Channel::PubSub_Info_Msg PubSub_Info_Msg
typedef ConnHandler< Channel,
Transport > 
ConnHandler
typedef Connector< Channel,
UnixSockTransport< Channel > > 
UnixSockConnector
typedef Connector< Channel,
TcpSockTransport< Channel > > 
TcpSockConnector
typedef Connector< Channel,
Transport > 
Connector
typedef Binder< typename Channel::IdType,
typename Channel::IdTrait
Binder
typedef Filter< typename Channel::IdType,
typename Channel::IdTrait
Filter
typedef Translator< typename
Channel::IdType, typename
Channel::IdTrait
Translator

Public Member Functions

void dump (void)
 RemoteInterface (ConnHandler *st, Interface_Role r, Channel *c)
 ~RemoteInterface ()
ConnHandlerconn_handler (void)
void conn_handler (ConnHandler *ch)
Interface_Role role (void)
void role (Interface_Role r)
void add_pending_msg (Msg *m)
void resend_pending_msgs (void)
Status notify_connected (ConnInfo addr)
Status handle_message (Msg *msg)
Status send2remote_chan_info (Interface_Type ct)
 send owner channel info to remote
Status send2remote_init_subscribe_msg (void)
Status send2remote_init_publish_msg (void)
Status send2remote_pubsub_msg (Oper_Type op, IdType t)
 forward local/owner channel memebers' pub/sub operations to remote
Member_Type type ()
 implement Destination methods
Status put_msg (Msg *msg, ACE_Time_Value *timeout=NULL)

Public Attributes

Interface_Role role_
Interface_State state_
 am i active or passive
ACE_Thread_Mutex lock_

Private Attributes

ConnHandlerconn_handler_
 my peer, a connection to remote channel
std::vector< Msg * > pending_msgs_
 msg buffering when connection to remote peer is not ready yet
Filterfilter_
 filter & translators: policies for remote connections
Translatortranslator_

Detailed Description

template<class Channel, class Transport>
class channel::RemoteInterface< Channel, Transport >

RemoteInterface: for connection to remote channels interact with owner channel as proxy of remote peer channel

Definition at line 245 of file Interface.h.


Member Typedef Documentation

template<class Channel, class Transport>
typedef Binder<typename Channel::IdType, typename Channel::IdTrait> channel::RemoteInterface< Channel, Transport >::Binder
 

Definition at line 258 of file Interface.h.

template<class Channel, class Transport>
typedef Channel::Channel_Info_Msg channel::RemoteInterface< Channel, Transport >::Channel_Info_Msg
 

Definition at line 252 of file Interface.h.

template<class Channel, class Transport>
typedef Connector<Channel, Transport> channel::RemoteInterface< Channel, Transport >::Connector
 

Definition at line 257 of file Interface.h.

template<class Channel, class Transport>
typedef ConnHandler<Channel, Transport> channel::RemoteInterface< Channel, Transport >::ConnHandler
 

Definition at line 254 of file Interface.h.

template<class Channel, class Transport>
typedef Channel::Destination channel::RemoteInterface< Channel, Transport >::Destination
 

Definition at line 251 of file Interface.h.

template<class Channel, class Transport>
typedef Filter<typename Channel::IdType, typename Channel::IdTrait> channel::RemoteInterface< Channel, Transport >::Filter
 

Definition at line 259 of file Interface.h.

template<class Channel, class Transport>
typedef Channel::IdTrait channel::RemoteInterface< Channel, Transport >::IdTrait
 

Definition at line 248 of file Interface.h.

template<class Channel, class Transport>
typedef Channel::IdType channel::RemoteInterface< Channel, Transport >::IdType
 

Definition at line 247 of file Interface.h.

template<class Channel, class Transport>
typedef Channel::Msg channel::RemoteInterface< Channel, Transport >::Msg
 

Definition at line 249 of file Interface.h.

template<class Channel, class Transport>
typedef Channel::PubSub_Info_Msg channel::RemoteInterface< Channel, Transport >::PubSub_Info_Msg
 

Definition at line 253 of file Interface.h.

template<class Channel, class Transport>
typedef Channel::Source channel::RemoteInterface< Channel, Transport >::Source
 

Definition at line 250 of file Interface.h.

template<class Channel, class Transport>
typedef Connector<Channel, TcpSockTransport<Channel> > channel::RemoteInterface< Channel, Transport >::TcpSockConnector
 

Definition at line 256 of file Interface.h.

template<class Channel, class Transport>
typedef Translator<typename Channel::IdType, typename Channel::IdTrait> channel::RemoteInterface< Channel, Transport >::Translator
 

Definition at line 260 of file Interface.h.

template<class Channel, class Transport>
typedef Connector<Channel, UnixSockTransport<Channel> > channel::RemoteInterface< Channel, Transport >::UnixSockConnector
 

Definition at line 255 of file Interface.h.


Constructor & Destructor Documentation

template<class Channel, class Transport>
channel::RemoteInterface< Channel, Transport >::RemoteInterface ConnHandler st,
Interface_Role  r,
Channel c
[inline]
 

Definition at line 274 of file Interface.h.

References channel::CONN_INIT, channel::Binder< IdType, IdTrait >::filter, channel::ConnHandler< Channel, Transport >::intf_, and channel::Binder< IdType, IdTrait >::translator.

template<class Channel, class Transport>
channel::RemoteInterface< Channel, Transport >::~RemoteInterface  )  [inline]
 

Definition at line 291 of file Interface.h.


Member Function Documentation

template<class Channel, class Transport>
void channel::RemoteInterface< Channel, Transport >::add_pending_msg Msg m  )  [inline]
 

methods handling msg buffering before remote connection is ready

Definition at line 301 of file Interface.h.

template<class Channel, class Transport>
void channel::RemoteInterface< Channel, Transport >::conn_handler ConnHandler ch  )  [inline]
 

Definition at line 293 of file Interface.h.

template<class Channel, class Transport>
ConnHandler* channel::RemoteInterface< Channel, Transport >::conn_handler void   )  [inline]
 

Definition at line 292 of file Interface.h.

template<class Channel, class Transport>
void channel::RemoteInterface< Channel, Transport >::dump void   ) 
 

template<class Channel, class Transport>
Status channel::RemoteInterface< Channel, Transport >::handle_message Msg msg  )  [inline]
 

main function to process remote msgs: 1> remote channel connect / disconnect 2> publish/unpublish, subscribe/unsubscribe 3> application msgs

handle msgs Channel internal management msgs

add interface(myself) to msg

send my subscription info

Q: why this->

send my subscription info

no need for init_pub_info msgs, since they are all handled inside

init_sub_msgs

Q: why this->

Q: why this->

remote msgs only for local destinations

forward all msgs to local channel

Definition at line 347 of file Interface.h.

References channel::ACTIVE_ROLE, channel::Channel_Info_Msg::conn_type, channel::Msg< IdType, SynchPolicy >::data(), channel::FAILURE, channel::Channel_Info_Msg::host_addr, ID2STR, channel::INET_SOCK, channel::Channel_Info_Msg::intf, channel::Channel_Info_Msg::is_local, channel::PubSub_Info_Msg< IdType >::msg_types, channel::PubSub_Info_Msg< IdType >::num_msg_types, channel::OPER_PUBLISH, channel::PASSIVE_ROLE, channel::Channel_Info_Msg::port, channel::SCOPE_LOCAL, channel::ConnInfo::set(), channel::Msg< IdType, SynchPolicy >::type, channel::Channel_Info_Msg::unix_addr, and channel::UNIX_SOCK.

template<class Channel, class Transport>
Status channel::RemoteInterface< Channel, Transport >::notify_connected ConnInfo  addr  )  [inline]
 

when the owner/local channel makes an active connection to remote channels, when socket connection call comes back successfully, fake a Channel_Info_Msg to tell owner channel member that a remote connection is ready (or connects in) fix me: need a better solution

Definition at line 318 of file Interface.h.

References channel::ConnInfo::type(), channel::ConnInfo::unix_addr(), channel::UNIX_SOCK, and channel::ConnInfo::valid().

Referenced by channel::ConnHandler< Channel, TcpSockTransport< Channel > >::set_up().

template<class Channel, class Transport>
Status channel::RemoteInterface< Channel, Transport >::put_msg Msg msg,
ACE_Time_Value *  timeout = NULL
[inline]
 

implement Destination (of owner channel) methods forward msgs from owner channel to remote peer

note: the msg_block don't own this out_msg (since it is not created by this mblk; we have to delete it explicitly in OutputMgr::send()

must be before put(), otherwise it could be deleted

Definition at line 607 of file Interface.h.

References channel::CONN_ACTIVE, channel::FAILURE, ID2STR, channel::SUCCESS, and channel::Msg< IdType, SynchPolicy >::type.

template<class Channel, class Transport>
void channel::RemoteInterface< Channel, Transport >::resend_pending_msgs void   )  [inline]
 

Definition at line 302 of file Interface.h.

References ID2STR.

template<class Channel, class Transport>
void channel::RemoteInterface< Channel, Transport >::role Interface_Role  r  )  [inline]
 

Definition at line 296 of file Interface.h.

template<class Channel, class Transport>
Interface_Role channel::RemoteInterface< Channel, Transport >::role void   )  [inline]
 

Definition at line 295 of file Interface.h.

template<class Channel, class Transport>
Status channel::RemoteInterface< Channel, Transport >::send2remote_chan_info Interface_Type  ct  )  [inline]
 

send owner channel info to remote

Definition at line 494 of file Interface.h.

References channel::Channel_Info_Msg::conn_type, channel::TcpSockTransport< Channel >::host_addr(), channel::Channel_Info_Msg::host_addr, channel::INET_SOCK, channel::TcpSockTransport< Channel >::port(), channel::Channel_Info_Msg::port, channel::UnixSockTransport< Channel >::unix_addr(), channel::Channel_Info_Msg::unix_addr, and channel::UNIX_SOCK.

Referenced by channel::ConnHandler< Channel, TcpSockTransport< Channel > >::set_up().

template<class Channel, class Transport>
Status channel::RemoteInterface< Channel, Transport >::send2remote_init_publish_msg void   )  [inline]
 

when 2 channels just connected, send all current pub info to remote

send subscription msg

Q: why this->

Definition at line 542 of file Interface.h.

References channel::PubSub_Info_Msg< IdType >::msg_types, and channel::PubSub_Info_Msg< IdType >::num_msg_types.

template<class Channel, class Transport>
Status channel::RemoteInterface< Channel, Transport >::send2remote_init_subscribe_msg void   )  [inline]
 

when 2 channels just connected, send all current sub info to remote

send subscription msg

Q: why this->

Definition at line 521 of file Interface.h.

References channel::PubSub_Info_Msg< IdType >::msg_types, and channel::PubSub_Info_Msg< IdType >::num_msg_types.

template<class Channel, class Transport>
Status channel::RemoteInterface< Channel, Transport >::send2remote_pubsub_msg Oper_Type  op,
IdType  t
[inline]
 

forward local/owner channel memebers' pub/sub operations to remote

Definition at line 562 of file Interface.h.

References channel::PubSub_Info_Msg< IdType >::msg_types, channel::PubSub_Info_Msg< IdType >::num_msg_types, channel::OPER_PUBLISH, channel::OPER_SUBSCRIBE, channel::OPER_UNPUBLISH, and channel::SUCCESS.

template<class Channel, class Transport>
Member_Type channel::RemoteInterface< Channel, Transport >::type void   )  [inline]
 

implement Destination methods

Definition at line 604 of file Interface.h.

References channel::MEMBER_REMOTE.


Member Data Documentation

template<class Channel, class Transport>
ConnHandler* channel::RemoteInterface< Channel, Transport >::conn_handler_ [private]
 

my peer, a connection to remote channel

Definition at line 264 of file Interface.h.

template<class Channel, class Transport>
Filter* channel::RemoteInterface< Channel, Transport >::filter_ [private]
 

filter & translators: policies for remote connections

Definition at line 268 of file Interface.h.

template<class Channel, class Transport>
ACE_Thread_Mutex channel::RemoteInterface< Channel, Transport >::lock_
 

Definition at line 654 of file Interface.h.

template<class Channel, class Transport>
std::vector<Msg *> channel::RemoteInterface< Channel, Transport >::pending_msgs_ [private]
 

msg buffering when connection to remote peer is not ready yet

Definition at line 266 of file Interface.h.

template<class Channel, class Transport>
Interface_Role channel::RemoteInterface< Channel, Transport >::role_
 

Definition at line 652 of file Interface.h.

template<class Channel, class Transport>
Interface_State channel::RemoteInterface< Channel, Transport >::state_
 

am i active or passive

Definition at line 653 of file Interface.h.

template<class Channel, class Transport>
Translator* channel::RemoteInterface< Channel, Transport >::translator_ [private]
 

Definition at line 269 of file Interface.h.


The documentation for this class was generated from the following file:
Generated on Mon Feb 27 19:59:23 2006 for channel by  doxygen 1.4.6-NO