Package com.hazelcast.core

Examples of com.hazelcast.core.DistributedObject


                if (!nodeEngine.isActive()) {
                    throw new HazelcastInstanceNotActiveException();
                }
                DistributedObjectFuture proxyFuture = new DistributedObjectFuture();
                if (proxies.putIfAbsent(name, proxyFuture) == null) {
                    DistributedObject proxy = service.createDistributedObject(name);
                    if (initialize && proxy instanceof InitializingObject) {
                        try {
                            ((InitializingObject) proxy).initialize();
                        } catch (Exception e) {
                            logger.warning("Error while initializing proxy: " + proxy, e);
View Full Code Here


        }

        void destroyProxy(String name, boolean publishEvent) {
            final DistributedObjectFuture proxyFuture = proxies.remove(name);
            if (proxyFuture != null) {
                DistributedObject proxy = proxyFuture.get();
                nodeEngine.eventService.executeEventCallback(new ProxyEventProcessor(DESTROYED, serviceName, proxy));
                if (publishEvent) {
                    publish(new DistributedObjectEventPacket(DESTROYED, serviceName, name));
                }
            }
View Full Code Here

            return proxies.containsKey(name);
        }

        void destroy() {
            for (DistributedObjectFuture future : proxies.values()) {
                DistributedObject distributedObject = future.get();
                if (distributedObject instanceof AbstractDistributedObject) {
                    ((AbstractDistributedObject) distributedObject).invalidate();
                }
            }
            proxies.clear();
View Full Code Here

    @Override
    public void invoke() {
        setSingleConnection();
        final MapService mapService = getService();
        final DistributedObject distributedObject
                = mapService.getMapServiceContext().getNodeEngine().getProxyService()
                .getDistributedObject(MapService.SERVICE_NAME, name);
        final MapProxyImpl mapProxy = (MapProxyImpl) distributedObject;
        mapProxy.loadAll(replaceExistingValues);
        final ClientEndpoint endpoint = getEndpoint();
View Full Code Here

    @Override
    public void invoke() {
        setSingleConnection();
        final MapService mapService = getService();
        final DistributedObject distributedObject
                = mapService.getMapServiceContext().getNodeEngine().getProxyService()
                .getDistributedObject(MapService.SERVICE_NAME, name);
        final MapProxyImpl mapProxy = (MapProxyImpl) distributedObject;
        mapProxy.loadAll(replaceExistingValues);
        final ClientEndpoint endpoint = getEndpoint();
View Full Code Here

                                Collection<DistributedObject> distributedObjects) {
        int count = 0;
        final Config config = instance.getConfig();
        final Iterator<DistributedObject> iterator = distributedObjects.iterator();
        while (iterator.hasNext() && count < maxVisibleInstanceCount) {
            DistributedObject distributedObject = iterator.next();
            if (distributedObject instanceof IMap) {
                count = handleMap(memberState, count, config, (IMap) distributedObject);
            } else if (distributedObject instanceof IQueue) {
                count = handleQueue(memberState, count, config, (IQueue) distributedObject);
            } else if (distributedObject instanceof ITopic) {
                count = handleTopic(memberState, count, config, (ITopic) distributedObject);
            } else if (distributedObject instanceof MultiMap) {
                count = handleMultimap(memberState, count, config, (MultiMap) distributedObject);
            } else if (distributedObject instanceof IExecutorService) {
                count = handleExecutorService(memberState, count, config, (IExecutorService) distributedObject);
            } else {
                LOGGER.finest("Distributed object ignored for monitoring: " + distributedObject.getName());
            }
        }

        if (cacheServiceEnabled) {
            final ICacheService cacheService = getCacheService();
View Full Code Here

        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        DistributedObject that = (DistributedObject) o;
        Object name = getName();
        if (name != null ? !name.equals(that.getName()) : that.getName() != null) {
            return false;
        }

        String serviceName = getServiceName();
        if (serviceName != null ? !serviceName.equals(that.getServiceName()) : that.getServiceName() != null) {
            return false;
        }

        return true;
    }
View Full Code Here

        ProxyRegistry registry = registries.get(serviceName);
        if (registry != null) {
            Collection<DistributedObjectFuture> futures = registry.proxies.values();
            for (DistributedObjectFuture future : futures) {
                try {
                    DistributedObject object = future.get();
                    objects.add(object);
                } catch (Throwable ignored) {
                    // ignore if proxy creation failed
                    EmptyStatement.ignore(ignored);
                }
View Full Code Here

        Collection<DistributedObject> objects = new LinkedList<DistributedObject>();
        for (ProxyRegistry registry : registries.values()) {
            Collection<DistributedObjectFuture> futures = registry.proxies.values();
            for (DistributedObjectFuture future : futures) {
                try {
                    DistributedObject object = future.get();
                    objects.add(object);
                } catch (Throwable ignored) {
                    // ignore if proxy creation failed
                    EmptyStatement.ignore(ignored);
                }
View Full Code Here

            for (Map.Entry<String, DistributedObjectFuture> entry : registry.proxies.entrySet()) {
                final DistributedObjectFuture future = entry.getValue();
                if (!future.isSet()) {
                    continue;
                }
                final DistributedObject distributedObject = future.get();
                if (distributedObject instanceof InitializingObject) {
                    proxies.add(new ProxyInfo(registry.serviceName, entry.getKey()));
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.hazelcast.core.DistributedObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.