@Override public final InboxAmp getInbox() { // OutboxAmpDirect outbox = new OutboxAmpDirect(); return _manager.inboxSystem(); }
private InboxAmp getInboxCaller() { return _ampManager.inboxSystem(); }
@Override public InboxAmp inboxSystem() { return delegate().inboxSystem(); }
public ChannelServerJampRpc(ServicesAmp manager, LookupAmp registry, Supplier<String> sessionSupplier) { Objects.requireNonNull(manager); _sessionSupplier = sessionSupplier; _manager = manager; _registry = registry; // _unparkQueue = unparkQueue; _outbox = new OutboxAmpBase(); _outbox.inbox(manager.inboxSystem()); //_outbox.message(manager.systemMessage()); }
@Override public InboxAmp inbox() { InboxAmp inbox = super.inbox(); if (inbox != null) { return inbox; } ServicesAmp manager = Amp.getContextManager(); if (manager != null) { return manager.inboxSystem(); } return _inboxThread; } }
default void run(Runnable task) { OutboxAmp outboxCurrent = OutboxAmp.current(); Object context = null; try (OutboxAmp outbox = OutboxAmp.currentOrCreate(this)) { context = outbox.getAndSetContext(inboxSystem()); task.run(); } finally { if (outboxCurrent != null) { outboxCurrent.getAndSetContext(context); } } }
@Override public ServiceRef currentServiceRef() { OutboxAmp outbox = OutboxAmp.current(); if (outbox != null) { return outbox.inbox().serviceRef(); } try { ServicesAmp manager = currentManager(); if (manager != null) { return manager.inboxSystem().serviceRef(); } else { return null; } } catch (Exception e) { log.log(Level.FINEST, e.toString(), e); return null; } }
InboxAmp systemInbox = serviceRef.services().inboxSystem(); MessageFactoryAmp messageFactory = _messageFactory;
public Object filter(Object value) { if (value == null) { return null; } if (value instanceof ProxyHandleAmp) { return value; } InboxAmp caller = Amp.getCurrentInbox(); InboxAmp inbox; if (caller != null) { inbox = caller; } else { inbox = _rampManager.inboxSystem(); } ServiceRefAmp serviceRef = inbox.serviceRef().pin(value); return serviceRef.as(_api); } }
public ChannelServerImpl(Supplier<ServicesAmp> managerRef, LookupAmp registry, OutAmp out, String sessionAddress, String sessionId) { _managerRef = managerRef; _registry = registry; //_out = out; _address = sessionAddress; _sessionId = sessionId; ServicesAmp manager = managerRef.get(); if (manager == null) { throw new ServiceExceptionIllegalState(L.l("ServiceManager is not available for this channel")); } ServiceRefAmp callerRef = manager.inboxSystem().serviceRef(); _serviceRefOut = out.createServiceRef(manager, sessionAddress, callerRef); bind(_address, _serviceRefOut); _serviceRefOut.start(); }
ServicesAmp manager = ServicesAmp.current(); return (T) manager.inboxSystem().serviceRef().pin(object).as(api);
_ampManager.inboxSystem().serviceRef().bind("/system");
oldCxt = outbox.getAndSetContext(_ampManager.inboxSystem());
outbox.inbox(_ampManager.inboxSystem());
protected void initSelf() { OutboxAmp outbox = OutboxAmp.current(); //_configBuilder = Configs.config(); //_configBuilder.add(_factory.config()); _injectBuilder = InjectorAmp.manager(classLoader()); _injectBuilder.include(BaratineProducer.class); _configBuilder = _injectBuilder.config(); _configBuilder.add(_factory.config()); _serviceBuilder = ServicesAmp.newManager(); _serviceBuilder.name("webapp"); _serviceBuilder.autoServices(true); _serviceBuilder.injector(_injectBuilder); //_serviceBuilder.setJournalFactory(new JournalFactoryImpl()); addFactories(_serviceBuilder); addStubVault(_serviceBuilder); _serviceBuilder.contextManager(true); ServicesAmp services = _serviceBuilder.get(); Amp.contextManager(services); _injectBuilder.autoBind(new InjectAutoBindService(services)); if (outbox != null) { InboxAmp inbox = services.inboxSystem(); // XXX: should set the inbox outbox.getAndSetContext(inbox); //System.out.println("OUTBOX-a: " + inbox + " " + serviceManager); } _wsManager = webSocketManager(); }
ServicesAmp ampManagerPod = ampBuilder.start(); ampManagerPod.inboxSystem().serviceRef().bind("public:///system");