001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.reef.javabridge;
020
021import org.apache.reef.annotations.audience.Interop;
022import org.apache.reef.annotations.audience.Private;
023
024/**
025 * A class that holds all handles to the .NET side.
026 * USED BY UNMANAGED CODE! PLEASE DO NOT CHANGE ANY FUNCTION SIGNATURES
027 * UNLESS YOU KNOW WHAT YOU ARE DOING!
028 */
029@Private
030@Interop(CppFiles = { "JavaClrBridge.cpp" }, CsFiles = { "BridgeHandlerManager.cs" })
031public final class BridgeHandlerManager {
032  private long allocatedEvaluatorHandler = 0;
033  private long activeContextHandler = 0;
034  private long taskMessageHandler = 0;
035  private long failedTaskHandler = 0;
036  private long failedEvaluatorHandler = 0;
037  private long httpServerEventHandler = 0;
038  private long completedTaskHandler = 0;
039  private long runningTaskHandler = 0;
040  private long suspendedTaskHandler = 0;
041  private long completedEvaluatorHandler = 0;
042  private long closedContextHandler = 0;
043  private long failedContextHandler = 0;
044  private long contextMessageHandler = 0;
045  private long driverRestartActiveContextHandler = 0;
046  private long driverRestartRunningTaskHandler = 0;
047  private long driverRestartCompletedHandler = 0;
048  private long driverRestartFailedEvaluatorHandler = 0;
049  private long progressProvider = 0;
050
051  public BridgeHandlerManager() {
052  }
053
054  public long getAllocatedEvaluatorHandler() {
055    return allocatedEvaluatorHandler;
056  }
057
058  public void setAllocatedEvaluatorHandler(final long allocatedEvaluatorHandler) {
059    this.allocatedEvaluatorHandler = allocatedEvaluatorHandler;
060  }
061
062  public long getActiveContextHandler() {
063    return activeContextHandler;
064  }
065
066  public void setActiveContextHandler(final long activeContextHandler) {
067    this.activeContextHandler = activeContextHandler;
068  }
069
070  public long getTaskMessageHandler() {
071    return taskMessageHandler;
072  }
073
074  public void setTaskMessageHandler(final long taskMessageHandler) {
075    this.taskMessageHandler = taskMessageHandler;
076  }
077
078  public long getFailedTaskHandler() {
079    return failedTaskHandler;
080  }
081
082  public void setFailedTaskHandler(final long failedTaskHandler) {
083    this.failedTaskHandler = failedTaskHandler;
084  }
085
086  public long getFailedEvaluatorHandler() {
087    return failedEvaluatorHandler;
088  }
089
090  public void setFailedEvaluatorHandler(final long failedEvaluatorHandler) {
091    this.failedEvaluatorHandler = failedEvaluatorHandler;
092  }
093
094  public long getHttpServerEventHandler() {
095    return httpServerEventHandler;
096  }
097
098  public void setHttpServerEventHandler(final long httpServerEventHandler) {
099    this.httpServerEventHandler = httpServerEventHandler;
100  }
101
102  public long getCompletedTaskHandler() {
103    return completedTaskHandler;
104  }
105
106  public void setCompletedTaskHandler(final long completedTaskHandler) {
107    this.completedTaskHandler = completedTaskHandler;
108  }
109
110  public long getRunningTaskHandler() {
111    return runningTaskHandler;
112  }
113
114  public void setRunningTaskHandler(final long runningTaskHandler) {
115    this.runningTaskHandler = runningTaskHandler;
116  }
117
118  public long getSuspendedTaskHandler() {
119    return suspendedTaskHandler;
120  }
121
122  public void setSuspendedTaskHandler(final long suspendedTaskHandler) {
123    this.suspendedTaskHandler = suspendedTaskHandler;
124  }
125
126  public long getCompletedEvaluatorHandler() {
127    return completedEvaluatorHandler;
128  }
129
130  public void setCompletedEvaluatorHandler(final long completedEvaluatorHandler) {
131    this.completedEvaluatorHandler = completedEvaluatorHandler;
132  }
133
134  public long getClosedContextHandler() {
135    return closedContextHandler;
136  }
137
138  public void setClosedContextHandler(final long closedContextHandler) {
139    this.closedContextHandler = closedContextHandler;
140  }
141
142  public long getFailedContextHandler() {
143    return failedContextHandler;
144  }
145
146  public void setFailedContextHandler(final long failedContextHandler) {
147    this.failedContextHandler = failedContextHandler;
148  }
149
150  public long getContextMessageHandler() {
151    return contextMessageHandler;
152  }
153
154  public void setContextMessageHandler(final long contextMessageHandler) {
155    this.contextMessageHandler = contextMessageHandler;
156  }
157
158  public long getDriverRestartActiveContextHandler() {
159    return driverRestartActiveContextHandler;
160  }
161
162  public void setDriverRestartActiveContextHandler(final long driverRestartActiveContextHandler) {
163    this.driverRestartActiveContextHandler = driverRestartActiveContextHandler;
164  }
165
166  public long getDriverRestartRunningTaskHandler() {
167    return driverRestartRunningTaskHandler;
168  }
169
170  public void setDriverRestartRunningTaskHandler(final long driverRestartRunningTaskHandler) {
171    this.driverRestartRunningTaskHandler = driverRestartRunningTaskHandler;
172  }
173
174  public long getDriverRestartCompletedHandler() {
175    return driverRestartCompletedHandler;
176  }
177
178  public void setDriverRestartCompletedHandler(final long driverRestartCompletedHandler) {
179    this.driverRestartCompletedHandler = driverRestartCompletedHandler;
180  }
181
182  public long getDriverRestartFailedEvaluatorHandler() {
183    return driverRestartFailedEvaluatorHandler;
184  }
185
186  public void setDriverRestartFailedEvaluatorHandler(final long driverRestartFailedEvaluatorHandler) {
187    this.driverRestartFailedEvaluatorHandler = driverRestartFailedEvaluatorHandler;
188  }
189
190  public long getProgressProvider() {
191    return progressProvider;
192  }
193
194  public void setProgressProvider(final long progressProvider) {
195    this.progressProvider = progressProvider;
196  }
197}