Search in sources :

Example 1 with ProxyInfo

use of com.hazelcast.spi.impl.proxyservice.impl.ProxyInfo 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)

Example 2 with ProxyInfo

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

the class PostJoinProxyOperation method readInternal.

@Override
protected void readInternal(ObjectDataInput in) throws IOException {
    super.readInternal(in);
    int len = in.readInt();
    if (len > 0) {
        proxies = new ArrayList<ProxyInfo>(len);
        for (int i = 0; i < len; i++) {
            ProxyInfo proxy = new ProxyInfo(in.readUTF(), (String) in.readObject());
            proxies.add(proxy);
        }
    }
}
Also used : ProxyInfo(com.hazelcast.spi.impl.proxyservice.impl.ProxyInfo)

Example 3 with ProxyInfo

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

the class PostJoinProxyOperation method writeInternal.

@Override
protected void writeInternal(ObjectDataOutput out) throws IOException {
    super.writeInternal(out);
    int len = proxies != null ? proxies.size() : 0;
    out.writeInt(len);
    if (len > 0) {
        for (ProxyInfo proxy : proxies) {
            out.writeUTF(proxy.getServiceName());
            out.writeObject(proxy.getObjectName());
        // writing as object for backward-compatibility
        }
    }
}
Also used : ProxyInfo(com.hazelcast.spi.impl.proxyservice.impl.ProxyInfo)

Aggregations

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