public void startBind() { _rowServiceImpl = new ClusterServiceKrakenImpl(_tableManager, this); ServiceRefAmp storeServiceRef = _tableManager.getStoreServiceRef(); ServiceRefAmp serviceRef = storeServiceRef.pin(_rowServiceImpl); _rowService = serviceRef.bind("public://" + ClusterServiceKraken.UID) .as(ClusterServiceKraken.class); }
public ClusterServiceKraken getProxy(String serverId) { ServiceRefAmp service = initService(serverId); if (service != null) { return service.as(ClusterServiceKraken.class); } else { return null; } }
void init() { if (getPod() == null) { return; } ServiceRefAmp serviceRef = ServiceRefAmp.current(); String podName = getPod().name(); if (getPodNode() != null && getPodNode().index() == 0) { serviceRef.pin(this) .bind("pod://" + podName + EventServerImpl.PATH); } ServicesAmp ampManager = AmpSystem.currentManager(); EventsSync events = ampManager.service(EventsSync.class); _updateHandle = events.subscriber(ServerOnUpdate.class, x->onServerUpdate(x)); }
String address = service.address(); if (! service.isPublic() && address.startsWith("public:")) { address = "pod:" + address.substring("public:".length()); if (! Object.class.equals(service.api().getType())) { out.println(" \"api\" : \"" + service.api().getType() + "\","); out.println(" \"queue-size\" : \"" + service.inbox().getSize() + "\""); out.print(" }");
ClassLoader loader = serviceRef.classLoader(); return serviceRef.as(_targetType);
@Override public InboxAmp inbox() { return _serviceRef.inbox(); }
methodRef = serviceRef.methodByName(_name, _type); methodRef = serviceRef.methodByName(_name); ClassLoader methodLoader = methodRef.serviceRef().classLoader(); || serviceRef.stub() instanceof StubLink) {
@Override public Object onLookup(String path, ServiceRefAmp parentRef) { PodRef podCaller = null; StubLink actorLink = new StubLink(getServiceManager(), path, parentRef, podCaller, this); ServiceRefAmp actorRef = parentRef.pin(actorLink, parentRef.address() + path); actorLink.initSelfRef(actorRef); // ServiceManagerAmp manager = getServiceManager(); //return manager.service(parentRef, actor, path); return actorRef; }
private ServiceRefAmp buildWorker() { ServiceConfig config = config(); StubFactoryAmp factory = new StubFactoryImpl(()->createStub(_worker), config); //ServiceRefAmp serviceRef = _manager.service(()->_worker, _address, config); ServiceRefAmp serviceRef = service(factory); if (_address != null) { if (_services.service(_address).isClosed()) { serviceRef = serviceRef.bind(_address); } } return serviceRef; }
public ChannelServerJampNew(RequestWeb req, WebJamp jamp, ServicesAmp manager) { Objects.requireNonNull(manager); //_sessionSupplier = sessionSupplier; _manager = manager; _registry = manager.registry(); // XXX: registry; _request = req; _jamp = jamp; // _unparkQueue = unparkQueue; _outbox = new OutboxAmpBase(); _outbox.inbox(ServiceRefAmp.current().inbox()); //_outbox.message(manager.systemMessage()); }
EventNodeClient(String podName, int nodeIndex, String path) { _podName = podName; _nodeIndex = nodeIndex; _address = path; String eventsPath = "pod://" + podName + EventServerImpl.PATH; ServicesAmp manager = ServicesAmp.current(); _eventServer = manager.service(eventsPath) .pinNode(_nodeIndex) .as(EventServer.class); }
String className = service.api().getType().getTypeName(); Collections.sort(systemServices, (a, b) -> a.address().compareTo(b.address())); Collections.sort(userServices, (a, b) -> a.address().compareTo(b.address())); sb.append(service.address()); sb.append("</td>"); sb.append(service.api().getType().getTypeName()); sb.append("</td>"); sb.append(service.address()); sb.append("</b></td>"); sb.append(service.api().getType().getTypeName()); sb.append("</td>"); if (service.address().startsWith("/")) { sb.append("<td>"); sb.append("@Inject @Service " + service.address().substring(1) + " service"); sb.append("</td>");
@Override public boolean isClosed() { ServiceRefAmp delegate = _delegateRef.get(); return delegate == null || delegate.isClosed(); }
protected StubAmpOut(ServicesAmp ampManager, String remoteAddress, ServiceRefAmp selfServiceRef) { Objects.requireNonNull(ampManager); Objects.requireNonNull(selfServiceRef); _ampManager = ampManager; _remoteAddress = remoteAddress; _selfServiceRef = selfServiceRef; _selfAddress = selfServiceRef.address(); }