ProxyKrakenRef(ServerBartender server, ServiceRef serviceRef) { _server = server; _serviceRef = serviceRef; _proxy = _serviceRef.as(ClusterServiceKraken.class); }
ProxyKrakenRef(ServerBartender server, ServiceRef serviceRef) { _server = server; _serviceRef = serviceRef; _proxy = _serviceRef.as(ClusterServiceKraken.class); }
BfsFileSync lookupFile(String path) { if (path.startsWith("bfs:")) { path = path.substring("bfs:".length()); } if (path.startsWith("//")) { } else if (path.startsWith("/")) { path = "//" + path; } return _rootServiceRef.service(path).as(BfsFileSync.class); }
protected BfsFileSync lookupFile(String fullPath) { return _root.service(fullPath).as(BfsFileSync.class); }
StoreSync<?> lookup(String path) { return _self.service(_scheme + "://" + _podName + path).as(StoreSync.class); }
public RepositoryImpl(Class<T> entityClass, Class<ID> idClass, DatabaseService db) { Objects.requireNonNull(entityClass); Objects.requireNonNull(idClass); _entityClass = entityClass; _idClass = idClass; if (db == null) { db = Services.current() .service("bardb:///") .as(DatabaseService.class); } _db = db; }
@Override public T toProxy(Object id) { if (id == null) { return null; } ServiceRef ref = _services.service(toAddress(id)); return ref.as(_entityClass); }
private Object readResolve() { return Services.current().service(_address).as(_api); } }
@Override public T convert(String key) { return manager().service(_address + key).as(_itemType); }
@Override public BfsFileSync lookup(String path) { if (path == null || path.equals("")) { return null; } String name = path.substring(1); PodBartender pod = _bartender.findActivePod(name); if (pod == null) { return null; } return _serviceRef.pin(new ProcPodBartender(pod)).as(FileServiceBind.class); }
private WatchTable getWatchTable(HashMap<TableKraken,WatchTable> map, TableKraken table) { WatchTable watchTable = map.get(table); if (watchTable == null) { watchTable = new WatchTable(table); TableListener listener = _serviceRef.pin(watchTable) .as(TableListener.class); table.addListener(listener); map.put(table, watchTable); } return watchTable; }
@Override public BfsFileSync lookup(String path) { if (path == null || path.equals("")) { return null; } String name = path.substring(1); TableKraken table = _tableManager.getTable(name); if (table == null) { return null; } ProcKrakenDebugTable debugTable = new ProcKrakenDebugTable(name); ServiceRef serviceRef = ServiceRef.current(); return serviceRef.pin(debugTable) .as(FileServiceBind.class); }
@OnActive public void onActive() { Services manager = AmpSystem.currentManager(); _linkEventPublisher = manager.service(LinkBartenderEvents.ADDRESS) .as(LinkBartenderEvents.class); }
@OnInit private void onStart() { _lifecycle.toActive(); _timerSelf = ServiceRef.current().as(TimerServiceAmp.class); }
@Override public ExitCode doCommandImpl(ArgsCli args, ServiceManagerClient client) { AdminServiceSync admin = client.service("remote:///management") .as(AdminServiceSync.class); String tag = args.getArg("tag"); if (tag == null) { throw new IllegalArgumentException(L.l("--tag is a required argument")); } String result = admin.backupLoad(tag); args.envCli().println(result); return ExitCode.OK; } }
public EventNodeActorClient(EventServiceRamp root, String podName, String address) { super(root, address); _podName = podName; _pod = BartenderSystem.current().findPod(_podName); String eventsPath = "pod://" + podName + EventServerImpl.PATH; ServicesAmp manager = ServicesAmp.current(); _podServiceRef = manager.service(eventsPath).pinNode(0); _podServer = _podServiceRef.as(EventServer.class); }
@Override protected ExitCode doCommandImpl(ArgsCli args, ServiceManagerClient client) { FilesDeployService service = client.service("remote:///bartender-files") .as(FilesDeployService.class); ArrayList<String> argList = args.getTailArgs(); boolean isHuman = args.getArgFlag("human"); boolean isSummary = args.getArgFlag("summary"); for (String path : argList) { printUsage(service, path, isHuman, isSummary); } return ExitCode.OK; }
public void start() { // _cacheReplicationActor = new CacheReplicationActor(_selfServer, _cacheService); // _cacheReplicationActor.start(); startRequestUpdates(); ServicesAmp services = AmpSystem.currentManager(); //ServiceRef podUpdateRef = services.service(PodOnUpdate.ADDRESS); _updateRef = _tableManager.getStoreServiceRef() .pin((PodOnUpdate) p->onPodUpdate(p)); EventsSync events = services.service(EventsSync.class); _updateCancel = events.subscriber(PodOnUpdate.class, _updateRef.as(PodOnUpdate.class)); }
@Test public void test() { ResultFuture<String> result = new ResultFuture<>(); _service.as(Q_basicService.class).test(result); Assert.assertEquals("Hello World!", result.get(1, TimeUnit.SECONDS)); }
@Test public void test() { ResultFuture<String> result = new ResultFuture<>(); _services.service("/hello").as(Q_basicService.class).test(result); Assert.assertEquals("Hello World!", result.get(1, TimeUnit.SECONDS)); }