Class: Baykit::BayServer::Protocol::ProtocolHandlerStore::ProtocolInfo
- Inherits:
-
Object
- Object
- Baykit::BayServer::Protocol::ProtocolHandlerStore::ProtocolInfo
- Defined in:
- lib/baykit/bayserver/protocol/protocol_handler_store.rb
Instance Attribute Summary collapse
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
-
#protocol_handler_factory ⇒ Object
readonly
Returns the value of attribute protocol_handler_factory.
-
#server_mode ⇒ Object
readonly
Returns the value of attribute server_mode.
-
#stores ⇒ Object
readonly
Returns the value of attribute stores.
Instance Method Summary collapse
- #add_agent(agt_id) ⇒ Object
-
#initialize(proto, svr_mode, proto_hnd_factory) ⇒ ProtocolInfo
constructor
A new instance of ProtocolInfo.
- #remove_agent(agt_id) ⇒ Object
Constructor Details
#initialize(proto, svr_mode, proto_hnd_factory) ⇒ ProtocolInfo
Returns a new instance of ProtocolInfo.
32 33 34 35 36 37 38 39 |
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 32 def initialize(proto, svr_mode, proto_hnd_factory) @protocol = proto @server_mode = svr_mode @protocol_handler_factory = proto_hnd_factory # Agent ID => ProtocolHandlerStore @stores = {} end |
Instance Attribute Details
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
27 28 29 |
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 27 def protocol @protocol end |
#protocol_handler_factory ⇒ Object (readonly)
Returns the value of attribute protocol_handler_factory.
29 30 31 |
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 29 def protocol_handler_factory @protocol_handler_factory end |
#server_mode ⇒ Object (readonly)
Returns the value of attribute server_mode.
28 29 30 |
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 28 def server_mode @server_mode end |
#stores ⇒ Object (readonly)
Returns the value of attribute stores.
30 31 32 |
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 30 def stores @stores end |
Instance Method Details
#add_agent(agt_id) ⇒ Object
41 42 43 44 |
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 41 def add_agent(agt_id) store = PacketStore.get_store(@protocol, agt_id); @stores[agt_id] = ProtocolHandlerStore.new(@protocol, @server_mode, @protocol_handler_factory, store); end |
#remove_agent(agt_id) ⇒ Object
46 47 48 |
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 46 def remove_agent(agt_id) @stores.delete(agt_id); end |