use of com.cinchapi.concourse.server.plugin.PluginRestricted in project concourse by cinchapi.
the class ConcourseServer method start.
/**
* Start the server.
*
* @throws TTransportException
*/
@PluginRestricted
public void start() throws TTransportException {
for (Engine engine : engines.values()) {
engine.start();
}
httpServer.start();
pluginManager.start();
Thread mgmtThread = new Thread(() -> {
mgmtServer.serve();
}, "management-server");
mgmtThread.setDaemon(true);
mgmtThread.start();
System.out.println("The Concourse server has started");
server.serve();
}
use of com.cinchapi.concourse.server.plugin.PluginRestricted in project concourse by cinchapi.
the class ConcourseServer method stop.
/**
* Stop the server.
*/
@PluginRestricted
public void stop() {
if (server.isServing()) {
mgmtServer.stop();
server.stop();
pluginManager.stop();
httpServer.stop();
for (Engine engine : engines.values()) {
engine.stop();
}
numEnginesInitialized.set(0);
System.out.println("The Concourse server has stopped");
}
}
use of com.cinchapi.concourse.server.plugin.PluginRestricted in project concourse by cinchapi.
the class ConcourseServer method invokeManagement.
@Override
@PluginRestricted
public ComplexTObject invokeManagement(String method, List<ComplexTObject> params, AccessToken creds) throws TException {
Object[] args = new Object[params.size() + 1];
for (int i = 0; i < params.size(); ++i) {
ComplexTObject arg = params.get(i);
args[i] = arg.getJavaObject();
}
args[args.length - 1] = creds;
try {
Object result = Reflection.callIf(invoked -> Reflection.isDeclaredAnnotationPresentInHierarchy(invoked, ClientInvokable.class), this, method, args);
return ComplexTObject.fromJavaObject(result);
} catch (IllegalStateException e) {
throw new ManagementException("The requested method invocation is either invalid or not " + "eligble for client-side invocation");
} catch (Exception e) {
throw new ManagementException(e.getMessage());
}
}
use of com.cinchapi.concourse.server.plugin.PluginRestricted in project concourse by cinchapi.
the class ConcourseServer method stage.
@Override
@TranslateClientExceptions
@PluginRestricted
@VerifyAccessToken
public TransactionToken stage(AccessToken creds, String env) throws TException {
TransactionToken token = new TransactionToken(creds, Time.now());
Transaction transaction = getEngine(env).startTransaction();
transactions.put(token, transaction);
Logger.info("Started Transaction {}", transaction);
return token;
}
Aggregations