1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
13 package org.simantics.utils.threads.ua;
18 * @author Toni Kalajainen (toni.kalajainen@vtt.fi)
20 public class State<StateType> extends AbstractState<StateType, RuntimeException> {
22 public State(StateType initialState) {
26 public boolean setState(StateType state) {
27 return super.setState(state);
30 public StateType setState(StateType state, java.util.concurrent.Executor listenerExecutor, java.util.Set<StateType> prerequisiteStates) {
31 return super.setState(state, listenerExecutor, prerequisiteStates);
34 public void setError(RuntimeException error) {
35 super.setError(error);
38 public StateType attemptSetState(java.util.Set<StateType> prerequisiteState, StateType newState) {
39 return super.attemptSetState(prerequisiteState, newState);
43 public void assertNoError() throws RuntimeException {
44 super.assertNoError();
48 protected void clearError() {