Package com.hazelcast.client

Examples of com.hazelcast.client.ClientEngine


    protected abstract Predicate getPredicate();

    @Override
    public Object call() {
        final ClientEndpoint endpoint = getEndpoint();
        final ClientEngine clientEngine = getClientEngine();
        final MapService mapService = getService();

        EntryListener<Object, Object> listener = new EntryListener<Object, Object>() {

            private void handleEvent(EntryEvent<Object, Object> event) {
                if (endpoint.live()) {
                    Data key = clientEngine.toData(event.getKey());
                    Data value = clientEngine.toData(event.getValue());
                    Data oldValue = clientEngine.toData(event.getOldValue());
                    PortableEntryEvent portableEntryEvent = new PortableEntryEvent(key, value, oldValue, event.getEventType(), event.getMember().getUuid());
                    endpoint.sendEvent(portableEntryEvent, getCallId());
                }
            }
View Full Code Here


    public RecoverAllTransactionsRequest() {
    }

    @Override
    public void invoke() {
        ClientEngine clientEngine = getClientEngine();
        ClusterService clusterService = clientEngine.getClusterService();
        Collection<MemberImpl> memberList = clusterService.getMemberList();
        TransactionManagerServiceImpl service = getService();

        List<Future<SerializableCollection>> futures = recoverTransactions(memberList);
        Set<Data> xids = new HashSet<Data>();
        for (Future<SerializableCollection> future : futures) {
            try {
                SerializableCollection collectionWrapper = future.get(RECOVER_TIMEOUT, TimeUnit.MILLISECONDS);
                for (Data data : collectionWrapper) {
                    RecoveredTransaction rt = (RecoveredTransaction) clientEngine.toObject(data);
                    service.addClientRecoveredTransaction(rt);
                    xids.add(clientEngine.toData(rt.getXid()));
                }
            } catch (MemberLeftException e) {
                ILogger logger = clientEngine.getLogger(RecoverAllTransactionsRequest.class);
                logger.warning("Member left while recovering: " + e);
            } catch (Throwable e) {
                handleException(clientEngine, e);
            }
        }
View Full Code Here

        this.delta = delta;
    }

    @Override
    protected int getPartition() {
        ClientEngine clientEngine = getClientEngine();
        Data key = clientEngine.getSerializationService().toData(name);
        return clientEngine.getPartitionService().getPartitionId(key);
    }
View Full Code Here

        this.function = function;
    }

    @Override
    protected int getPartition() {
        ClientEngine clientEngine = getClientEngine();
        Data key = clientEngine.getSerializationService().toData(name);
        return getClientEngine().getPartitionService().getPartitionId(key);
    }
View Full Code Here

        return new PublishOperation(name, message);
    }

    @Override
    protected int getPartition() {
        ClientEngine clientEngine = getClientEngine();
        Data key = clientEngine.toData(name);
        return clientEngine.getPartitionService().getPartitionId(key);
    }
View Full Code Here

        this.name = name;
    }

    @Override
    protected int getPartition() {
        ClientEngine clientEngine = getClientEngine();
        Data key = clientEngine.getSerializationService().toData(name);
        return clientEngine.getPartitionService().getPartitionId(key);
    }
View Full Code Here

    }

    @Override
    public String call() throws Exception {
        TopicService service = getService();
        ClientEngine clientEngine = getClientEngine();
        ClientEndpoint endpoint = getEndpoint();
        MessageListener listener = new MessageListenerImpl(endpoint, clientEngine, getCallId());
        String registrationId = service.addMessageListener(name, listener);
        endpoint.setListenerRegistration(TopicService.SERVICE_NAME, name, registrationId);
        return registrationId;
View Full Code Here

        this.update = update;
    }

    @Override
    protected int getPartition() {
        ClientEngine clientEngine = getClientEngine();
        Data key = clientEngine.getSerializationService().toData(name);
        return clientEngine.getPartitionService().getPartitionId(key);
    }
View Full Code Here

        this.permitCount = permitCount;
    }

    @Override
    protected int getPartition() {
        ClientEngine clientEngine = getClientEngine();
        Data key = clientEngine.getSerializationService().toData(name);
        return clientEngine.getPartitionService().getPartitionId(key);
    }
View Full Code Here

        this.name = name;
    }

    @Override
    protected int getPartition() {
        ClientEngine clientEngine = getClientEngine();
        Data key = clientEngine.getSerializationService().toData(name);
        return clientEngine.getPartitionService().getPartitionId(key);
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.client.ClientEngine

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.