Examples of processEvent()


Examples of org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo.processEvent()

                }
                future.complete(res);
            } else {
                for (Map.Entry<VolumeInfo, DataStore> entry : volumeToPool.entrySet()) {
                    VolumeInfo volume = entry.getKey();
                    volume.processEvent(Event.OperationSuccessed);
                }
                future.complete(res);
            }
        } catch (Exception e) {
            s_logger.error("Failed to process copy volume callback", e);
View Full Code Here

Examples of org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo.processEvent()

        AsyncCallFuture<VolumeApiResult> future = context.future;
        VolumeInfo volume = (VolumeInfo) context.volume;

        if (result.isFailed()) {
            try {
                volume.processEvent(Event.OperationFailed);
            } catch (Exception e) {
                s_logger.debug("Failed to change state", e);
            }
            VolumeApiResult res = new VolumeApiResult(volume);
            res.setResult(result.getResult());
View Full Code Here

Examples of org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo.processEvent()

            future.complete(res);
            return null;
        }

        try {
            volume.processEvent(Event.OperationSuccessed);
        } catch (Exception e) {
            s_logger.debug("Failed to change state", e);
            VolumeApiResult res = new VolumeApiResult(volume);
            res.setResult(result.getResult());
            future.complete(res);
View Full Code Here

Examples of org.apache.cloudstack.storage.image.store.TemplateObject.processEvent()

            AsyncCompletionCallback<TemplateApiResult> callback) {
        // persist template_store_ref entry
        TemplateObject templateOnStore = (TemplateObject) store.create(template);
        // update template_store_ref and template state
        try {
            templateOnStore.processEvent(ObjectInDataStoreStateMachine.Event.CreateOnlyRequested);
        } catch (Exception e) {
            TemplateApiResult result = new TemplateApiResult(templateOnStore);
            result.setResult(e.toString());
            result.setSuccess(false);
            if (callback != null) {
View Full Code Here

Examples of org.apache.cloudstack.storage.image.store.TemplateObject.processEvent()

        TemplateObject template = context.getTemplate();
        AsyncCompletionCallback<TemplateApiResult> parentCallback = context.getParentCallback();
        TemplateApiResult result = new TemplateApiResult(template);
        CreateCmdResult callbackResult = callback.getResult();
        if (callbackResult.isFailed()) {
            template.processEvent(ObjectInDataStoreStateMachine.Event.OperationFailed);
            result.setResult(callbackResult.getResult());
            if (parentCallback != null) {
                parentCallback.complete(result);
            }
            return null;
View Full Code Here

Examples of org.apache.cloudstack.storage.image.store.TemplateObject.processEvent()

            }
            return null;
        }

        try {
            template.processEvent(ObjectInDataStoreStateMachine.Event.OperationSuccessed);
        } catch (Exception e) {
            result.setResult(e.toString());
            if (parentCallback != null) {
                parentCallback.complete(result);
            }
View Full Code Here

Examples of org.apache.cloudstack.storage.image.store.TemplateObject.processEvent()

    @Override
    public AsyncCallFuture<TemplateApiResult> deleteTemplateAsync(TemplateInfo template) {
        TemplateObject to = (TemplateObject) template;
        // update template_store_ref status
        to.processEvent(ObjectInDataStoreStateMachine.Event.DestroyRequested);

        AsyncCallFuture<TemplateApiResult> future = new AsyncCallFuture<TemplateApiResult>();

        TemplateOpContext<TemplateApiResult> context = new TemplateOpContext<TemplateApiResult>(null, to, future);
        AsyncCallbackDispatcher<TemplateServiceImpl, CommandResult> caller = AsyncCallbackDispatcher.create(this);
View Full Code Here

Examples of org.apache.cloudstack.storage.image.store.TemplateObject.processEvent()

    public Void deleteTemplateCallback(AsyncCallbackDispatcher<TemplateServiceImpl, CommandResult> callback,
            TemplateOpContext<TemplateApiResult> context) {
        CommandResult result = callback.getResult();
        TemplateObject vo = context.getTemplate();
        if (result.isSuccess()) {
            vo.processEvent(Event.OperationSuccessed);
        } else {
            vo.processEvent(Event.OperationFailed);
        }
        TemplateApiResult apiResult = new TemplateApiResult(vo);
        apiResult.setResult(result.getResult());
View Full Code Here

Examples of org.apache.cocoon.caching.EventAware.processEvent()

                    this.getLogger().debug(
                        "Notifying "
                            + this.serviceName
                            + " of "
                            + events[i]);
                service.processEvent(events[i]);
            }
        } catch (ServiceException e) {
            if (this.getLogger().isErrorEnabled()) {
                this.getLogger().error(
                    "Could not obtain " + this.serviceName + " from component manager.",
View Full Code Here

Examples of org.apache.flume.channel.ChannelProcessor.processEvent()

    Map<String, String> headers = Maps.newHashMap();
    String badWord = "scribe";
    headers.put("Bad-Words", badWord);
    Event event1 = EventBuilder.withBody("test", Charsets.UTF_8, headers);
    Assert.assertEquals(badWord, event1.getHeaders().get("Bad-Words"));
    cp.processEvent(event1);

    Transaction tx = memCh.getTransaction();
    tx.begin();

    Event event1a = memCh.take();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.