Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 6f13e994d5d5b4657eceef991bab7addddf86afe (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*******************************************************************************
 * Copyright (c) 2011 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.equinox.coordinator;

import java.util.List;
import java.util.Map;

import org.osgi.framework.Bundle;
import org.osgi.service.coordinator.Coordination;
import org.osgi.service.coordinator.Participant;

public class CoordinationReferent implements Coordination {
	private final CoordinationImpl coordination;
	
	public CoordinationReferent(CoordinationImpl coordination) {
		if (coordination == null)
			throw new NullPointerException();
		this.coordination = coordination;
	}

	public long getId() {
		return coordination.getId();
	}

	public String getName() {
		return coordination.getName();
	}

	public void end() {
		coordination.end();
	}

	public boolean fail(Throwable cause) {
		return coordination.fail(cause);
	}

	public Throwable getFailure() {
		return coordination.getFailure();
	}

	public boolean isTerminated() {
		return coordination.isTerminated();
	}

	public void addParticipant(Participant participant) {
		coordination.addParticipant(participant);
	}

	public List<Participant> getParticipants() {
		return coordination.getParticipants();
	}

	public Map<Class<?>, Object> getVariables() {
		return coordination.getVariables();
	}

	public long extendTimeout(long timeMillis) {
		return coordination.extendTimeout(timeMillis);
	}

	public void join(long timeMillis) throws InterruptedException {
		coordination.join(timeMillis);
	}

	public Coordination push() {
		return coordination.push();
	}

	public Thread getThread() {
		return coordination.getThread();
	}

	public Bundle getBundle() {
		return coordination.getBundle();
	}

	public Coordination getEnclosingCoordination() {
		return coordination.getEnclosingCoordination();
	}
	
	@Override
	public boolean equals(Object object) {
		if (object == this)
			return true;
		if (!(object instanceof CoordinationReferent))
			return false;
		return coordination.equals(((CoordinationReferent)object).coordination);
	}
	
	@Override
	public int hashCode() {
		return coordination.hashCode();
	}
	
	CoordinationImpl getDelegate() {
		return coordination;
	}
}

Back to the top