const char *path) = 0;
virtual void start() const;
+
+ virtual void stop() const;
};
class FilterException : public std::runtime_error {
virtual RoutePos *createpos() const = 0;
virtual void start() = 0;
+ virtual void stop() = 0;
};
class RoutePos : boost::noncopyable {
{
}
+void mp::filter::Base::stop() const
+{
+}
+
/*
* Local variables:
* c-basic-offset: 4
delete m_p->az[i];
delete [] m_p->az;
}
+ m_p->az = 0;
+}
+
+void mp::filter::FrontendNet::stop() const
+{
+ if (m_p->az)
+ {
+ size_t i;
+ for (i = 0; i<m_p->m_ports.size(); i++)
+ m_p->az[i]->server("");
+ }
}
bool mp::My_Timer_Thread::timeout()
void process(metaproxy_1::Package & package) const;
void configure(const xmlNode * ptr, bool test_only,
const char *path);
+ void stop() const;
public:
/// set ports
void set_ports(std::vector<Port> &ports);
static void sig_term_handler(int s)
{
+ routerp->stop();
+#if 0
kill(-process_group, SIGTERM); /* kill all children processes as well */
_exit(0);
+#endif
}
#endif
mp::Package pack;
pack.router(*routerp).move(); /* should never exit */
+ _exit(0);
}
static void handler_normal(void *data)
(*it)->start();
}
+void mp::RouterChain::stop()
+{
+ std::list<const filter::Base *>::const_iterator it;
+
+ for (it = m_p->m_filter_list.begin(); it != m_p->m_filter_list.end(); it++)
+ (*it)->stop();
+}
+
const mp::filter::Base *mp::RouterChain::Pos::move(const char *route)
{
if (it == m_p->m_filter_list.end())
return p;
}
-
mp::RouterChain::Pos::~Pos()
{
}
virtual RoutePos *createpos() const;
RouterChain & append(const filter::Base &filter);
void start();
+ void stop();
private:
boost::scoped_ptr<Rep> m_p;
/// disabled because class is singleton
}
}
+void mp::RouterFleXML::stop()
+{
+ std::map<std::string,RouterFleXML::Route>::iterator route_it;
+
+ route_it = m_p->m_routes.begin();
+ while (route_it != m_p->m_routes.end())
+ {
+ RouterFleXML::Route route = route_it->second;
+
+ std::list<boost::shared_ptr<const mp::filter::Base> >::iterator it;
+
+ for (it = route.m_list.begin(); it != route.m_list.end(); it++)
+ (*it)->stop();
+ route_it++;
+ }
+}
+
+
/*
* Local variables:
* c-basic-offset: 4
virtual RoutePos *createpos() const;
void start();
+ void stop();
private:
boost::scoped_ptr<Rep> m_p;
};