blob: 1afe71f73b3805f671b38e8d2c294ea913d6abc6 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2009, 2017 Stephan Wahlbrink and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.rj.server.srv.engine;
import java.rmi.RemoteException;
import java.util.Map;
import org.eclipse.statet.rj.server.REngine;
import org.eclipse.statet.rj.server.RjsComObject;
import org.eclipse.statet.rj.server.Server;
import org.eclipse.statet.rj.server.srvext.Client;
public final class REngineImpl implements REngine {
private final Server publicServer;
private final SrvEngine srvEngine;
private final Client client;
public REngineImpl(final Server publicServer, final SrvEngine srvEngine, final Client client) {
this.publicServer= publicServer;
this.srvEngine= srvEngine;
this.client= client;
}
@Override
public Server getPublic() throws RemoteException {
return this.publicServer;
}
@Override
public Map<String, Object> getPlatformData() {
return this.srvEngine.getPlatformData();
}
@Override
public void setProperties(final Map<String, ? extends Object> properties) throws RemoteException {
this.srvEngine.setProperties(this.client, properties);
}
@Override
public void disconnect() throws RemoteException {
this.srvEngine.disconnect(this.client);
}
@Override
public RjsComObject runAsync(final RjsComObject com) throws RemoteException {
return this.srvEngine.runAsync(this.client, com);
}
@Override
public RjsComObject runMainLoop(final RjsComObject com) throws RemoteException {
return this.srvEngine.runMainLoop(this.client, com);
}
@Override
public boolean isClosed() throws RemoteException {
return (this.srvEngine.getCurrentClient() != this.client);
}
}