activemq-cpp-3.8.2
BrokenBarrierException.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef _DECAF_UTIL_CONCURRENT_BROKENBARRIEREXCEPTION_H_
18 #define _DECAF_UTIL_CONCURRENT_BROKENBARRIEREXCEPTION_H_
19 
20 #include <decaf/lang/Exception.h>
21 
22 namespace decaf{
23 namespace util{
24 namespace concurrent{
25 
26  /*
27  * Exception thrown when a thread tries to wait upon a barrier that is in a broken
28  * state, or which enters the broken state while the thread is waiting.
29  */
31  public:
32 
36  BrokenBarrierException() : decaf::lang::Exception() {}
37 
45  : decaf::lang::Exception()
46  {
47  *(Exception*)this = ex;
48  }
49 
57  : decaf::lang::Exception()
58  {
59  *(Exception*)this = ex;
60  }
61 
67  BrokenBarrierException( const std::exception* cause )
68  : decaf::lang::Exception( cause ) {}
69 
79  BrokenBarrierException( const char* file, const int lineNumber,
80  const char* msg, ... )
81  : decaf::lang::Exception()
82  {
83 
84  va_list vargs;
85  va_start( vargs, msg );
86  buildMessage( msg, vargs );
87 
88  // Set the first mark for this exception.
89  setMark( file, lineNumber );
90  }
91 
102  BrokenBarrierException( const char* file, const int lineNumber,
103  const std::exception* cause,
104  const char* msg, ... )
105  : decaf::lang::Exception( cause )
106  {
107  va_list vargs ;
108  va_start( vargs, msg );
109  buildMessage( msg, vargs );
110 
111  // Set the first mark for this exception.
112  setMark( file, lineNumber );
113  }
114 
122  virtual BrokenBarrierException* clone() const{
123  return new BrokenBarrierException( *this );
124  }
125 
126  virtual ~BrokenBarrierException() throw();
127 
128  };
129 
130 }}}
131 
132 #endif /*_DECAF_UTIL_CONCURRENT_BROKENBARRIEREXCEPTION_H_*/
Definition: BrokenBarrierException.h:30
BrokenBarrierException(const BrokenBarrierException &ex)
Copy Constructor.
Definition: BrokenBarrierException.h:56
BrokenBarrierException(const std::exception *cause)
Constructor.
Definition: BrokenBarrierException.h:67
BrokenBarrierException(const char *file, const int lineNumber, const std::exception *cause, const char *msg,...)
Constructor - Initializes the file name and line number where this message occurred.
Definition: BrokenBarrierException.h:102
virtual BrokenBarrierException * clone() const
Clones this exception.
Definition: BrokenBarrierException.h:122
BrokenBarrierException()
Default Constructor.
Definition: BrokenBarrierException.h:36
BrokenBarrierException(const char *file, const int lineNumber, const char *msg,...)
Constructor - Initializes the file name and line number where this message occurred.
Definition: BrokenBarrierException.h:79
BrokenBarrierException(const decaf::lang::Exception &ex)
Conversion Constructor from some other Exception.
Definition: BrokenBarrierException.h:44
#define DECAF_API
Definition: Config.h:29
Definition: Exception.h:38
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25