use of com.bluenimble.platform.remote.impls.http.HttpRemote in project serverless by bluenimble.
the class RemotePlugin method init.
@Override
public void init(final ApiServer server) throws Exception {
Feature aFeature = Remote.class.getAnnotation(Feature.class);
if (aFeature == null || Lang.isNullOrEmpty(aFeature.name())) {
return;
}
feature = aFeature.name();
PackageClassLoader pcl = (PackageClassLoader) RemotePlugin.class.getClassLoader();
pcl.registerObject(Protocol.http.name(), new HttpRemote(null));
server.addFeature(new ServerFeature() {
private static final long serialVersionUID = -9012279234275100528L;
@Override
public Class<?> type() {
return Remote.class;
}
@Override
public Object get(ApiSpace space, String name) {
return remotes.get(createRemoteKey(name, space));
}
@Override
public String provider() {
return RemotePlugin.this.getName();
}
@Override
public Plugin implementor() {
return RemotePlugin.this;
}
});
}
Aggregations