use of com.bluenimble.platform.plugins.database.orientdb.impls.OrientDatabase in project serverless by bluenimble.
the class OrientDatabasePlugin method init.
@Override
public void init(final ApiServer server) throws Exception {
weight = server.weight();
Feature aFeature = Database.class.getAnnotation(Feature.class);
if (aFeature == null || Lang.isNullOrEmpty(aFeature.name())) {
return;
}
feature = aFeature.name();
// add features
server.addFeature(new ServerFeature() {
private static final long serialVersionUID = 2626039344401539390L;
@Override
public Class<?> type() {
return Database.class;
}
@Override
public Object get(ApiSpace space, String name) {
return new OrientDatabase(OrientDatabasePlugin.this.acquire(space, name), tracer());
}
@Override
public Plugin implementor() {
return OrientDatabasePlugin.this;
}
@Override
public String provider() {
return OrientDatabasePlugin.this.getName();
}
});
if (Orient.instance() != null) {
Orient.instance().removeShutdownHook();
}
}
Aggregations