Search in sources :

Example 1 with ProxyRegistry

use of com.hazelcast.spi.impl.proxyservice.impl.ProxyRegistry in project hazelcast by hazelcast.

the class PostJoinProxyOperation method run.

@Override
public void run() throws Exception {
    if (proxies == null || proxies.size() <= 0) {
        return;
    }
    NodeEngine nodeEngine = getNodeEngine();
    ProxyServiceImpl proxyService = getService();
    ExecutionService executionService = nodeEngine.getExecutionService();
    for (final ProxyInfo proxy : proxies) {
        final ProxyRegistry registry = proxyService.getOrCreateRegistry(proxy.getServiceName());
        try {
            executionService.execute(ExecutionService.SYSTEM_EXECUTOR, new Runnable() {

                @Override
                public void run() {
                    registry.createProxy(proxy.getObjectName(), false, true);
                }
            });
        } catch (Throwable t) {
            getLogger().warning("Cannot create proxy [" + proxy.getServiceName() + ":" + proxy.getObjectName() + "]!", t);
        }
    }
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) ProxyInfo(com.hazelcast.spi.impl.proxyservice.impl.ProxyInfo) ProxyRegistry(com.hazelcast.spi.impl.proxyservice.impl.ProxyRegistry) ProxyServiceImpl(com.hazelcast.spi.impl.proxyservice.impl.ProxyServiceImpl) ExecutionService(com.hazelcast.spi.ExecutionService)

Aggregations

ExecutionService (com.hazelcast.spi.ExecutionService)1 NodeEngine (com.hazelcast.spi.NodeEngine)1 ProxyInfo (com.hazelcast.spi.impl.proxyservice.impl.ProxyInfo)1 ProxyRegistry (com.hazelcast.spi.impl.proxyservice.impl.ProxyRegistry)1 ProxyServiceImpl (com.hazelcast.spi.impl.proxyservice.impl.ProxyServiceImpl)1