Remove dynamic exceptions
[anna.git] / source / comm / Server.cpp
index 82330c4..9be5fcc 100644 (file)
@@ -1,37 +1,9 @@
-// ANNA - Anna is Not Nothingness Anymore
-//
-// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
-//
-// https://bitbucket.org/testillano/anna
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: eduardo.ramos.testillano@gmail.com
-//          cisco.tierra@gmail.com
+// ANNA - Anna is Not Nothingness Anymore                                                         //
+//                                                                                                //
+// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
+//                                                                                                //
+// See project site at http://redmine.teslayout.com/projects/anna-suite                           //
+// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
 
 
 #include <anna/core/tracing/Logger.hpp>
@@ -94,7 +66,7 @@ comm::Server::~Server() {
  * orden que el usado en el Server::connect.
  */
 void comm::Server::reset()
-throw(RuntimeException) {
+noexcept(false) {
 // La SSCC se establece en el método que invoca a éste
 //   Guard guard (*this, "comm::Server::reset");
   if(a_clientSocket == NULL)
@@ -106,7 +78,7 @@ throw(RuntimeException) {
 }
 
 void comm::Server::setReceiverFactory(comm::ReceiverFactory& receiverFactory)
-throw() {
+{
   a_receiverFactory = &receiverFactory;
 
   if(a_clientSocket != NULL)
@@ -156,7 +128,7 @@ throw() {
 
 */
 void comm::Server::connect()
-throw(RuntimeException) {
+noexcept(false) {
   LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::Server", "connect", ANNA_FILE_LOCATION));
   Communicator* communicator = functions::component <Communicator> (ANNA_FILE_LOCATION);
   /*
@@ -223,7 +195,7 @@ throw(RuntimeException) {
 // se intenta usar => se intenta volver a conectar antes de dar el fallo.
 //---------------------------------------------------------------------------------------
 comm::ClientSocket* comm::Server::send(Message& message)
-throw(RuntimeException) {
+noexcept(false) {
   LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::Server", "send", ANNA_FILE_LOCATION));
   Guard guard(*this, "comm::Server::send");
   const bool available = isAvailable();
@@ -243,32 +215,32 @@ throw(RuntimeException) {
 }
 
 comm::ClientSocket* comm::Server::send(Message* message)
-throw(RuntimeException) {
+noexcept(false) {
   if(message == NULL)
     throw RuntimeException("anna::comm::Server::send | Cannot send a NULL message", ANNA_FILE_LOCATION);
 
   return send(*message);
 }
 
-void comm::Server::setAutoRecovery(bool autoRecovery) throw() {
+void comm::Server::setAutoRecovery(bool autoRecovery) {
   bool* ar = const_cast <bool*>(&a_autoRecovery);
   *ar = autoRecovery;
 }
 
 bool comm::Server::isAvailable() const
-throw(RuntimeException) {
+noexcept(false) {
 //   Guard guard (*this, "comm::Server::isAvailable");
   return (a_clientSocket == NULL) ? false : (a_clientSocket->isConnected() && (a_clientSocket->isClosedPending() == false));
 }
 
 //  Este metodo sea re-escrito en commsec::Server::allocateClientSocket para devolver un commsec::RemoteConnection
 comm::ClientSocket* comm::Server::allocateClientSocket(const comm::INetAddress& in, comm::TransportFactory* transportFactory) const
-throw() {
+{
   return new ClientSocket(in, transportFactory);
 }
 
 string comm::Server::asString() const
-throw() {
+{
   string result("comm::Server { ");
   result += Resource::asString();
   result += " |  Sequence: ";
@@ -288,7 +260,7 @@ throw() {
 }
 
 xml::Node* comm::Server::asXML(xml::Node* parent) const
-throw(RuntimeException) {
+noexcept(false) {
   xml::Node* result = parent->createChild("comm.Server");
   result->createAttribute("Host", a_host.getName());
   result->createAttribute("Sequence", a_sequence);