Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a7651c864c8c73dffd8022bc49953d361d64a9b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
 * 
 */
package org.eclipse.papyrus.infra.core.serviceregistry;

/**
 * @author cedric dumoulin
 * 
 */
public class BadStateException extends ServiceException {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Constructor.
	 * 
	 */
	public BadStateException(ServiceState expectedState, ServiceState state, ServiceDescriptor descriptor) {
		super("Bad state for service '" + descriptor.getKey() + "'. Expected '" + expectedState + "' found '" + state + "'.");
	}

	/**
	 * 
	 * Constructor.
	 * 
	 * @param text
	 * @param state
	 * @param serviceDescriptor
	 */
	public BadStateException(String text, ServiceState state, ServiceDescriptor descriptor) {
		super(text + " (Service= '" + (descriptor!=null?descriptor.getKey():"unknown") + ", state= " + state + ")");
	}

	/**
	 * 
	 * Constructor.
	 * 
	 * @param text
	 * @param state
	 * @param serviceDescriptor
	 */
	public BadStateException(String text, ServiceState state, ServiceDescriptor descriptor, Throwable cause) {
		super(text + " (Service= '" + descriptor.getKey() + ", state= " + state + ")", cause);
	}

}

Back to the top