当前位置: 首页>>代码示例>>Java>>正文


Java ErrorCallback类代码示例

本文整理汇总了Java中org.jboss.errai.common.client.api.ErrorCallback的典型用法代码示例。如果您正苦于以下问题:Java ErrorCallback类的具体用法?Java ErrorCallback怎么用?Java ErrorCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ErrorCallback类属于org.jboss.errai.common.client.api包,在下文中一共展示了ErrorCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: load

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
@Override
public <U extends BasePreference<U>, T extends BasePreferencePortable<U>> void load(final T emptyPortablePreference,
                                                                                    final ParameterizedCommand<T> successCallback,
                                                                                    final ParameterizedCommand<Throwable> errorCallback) {
    store.call(new RemoteCallback<T>() {
                   @Override
                   public void callback(final T portablePreference) {
                       if (successCallback != null) {
                           successCallback.execute(portablePreference);
                       }
                   }
               },
               new ErrorCallback<Throwable>() {
                   @Override
                   public boolean error(final Throwable throwable,
                                        final Throwable throwable2) {
                       if (errorCallback != null) {
                           errorCallback.execute(throwable);
                       }
                       return false;
                   }
               }).load(emptyPortablePreference);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:PreferenceBeanStoreImpl.java

示例2: init

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
public void init(final String xml03File) {
    bayesianService.call(new RemoteCallback<BayesNetwork>() {
                             @Override
                             public void callback(final BayesNetwork response) {
                                 bayesianNodes.clear();
                                 for (BayesVariable bay : response.getNodos()) {
                                     drawBayesianNode(bay);
                                 }
                                 readyEvent.fire(new RenderBayesianNetworkEvent(bayesianNodes));
                             }
                         },
                         new ErrorCallback<Object>() {

                             @Override
                             public boolean error(Object message,
                                                  Throwable throwable) {
                                 Window.alert("Sorry.. the " + xml03File + " could not be read..");
                                 ProgressBar.setInfinite(false);
                                 return false;
                             }
                         }
    ).buildXml03(BayesianUtils.XML3_RESOURCE_PATH + xml03File);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:BayesianFactory.java

示例3: loadContent

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
@OnOpen
public void loadContent() {
    view.clear();

    appService.call(new RemoteCallback<Directory>() {
                        public void callback(Directory root_) {
                            root = root_;
                            currentDirectory = root_;
                            setupView();
                        }
                    },
                    new ErrorCallback<Object>() {
                        @Override
                        public boolean error(Object o,
                                             Throwable throwable) {
                            return false;
                        }
                    }).getRootDirectory();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:AppsHomePresenter.java

示例4: _lookupDataSet

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
private void _lookupDataSet(DataSetLookup request,
                            final DataSetReadyCallback listener) {
    try {
        dataSetLookupServices.call(
                new RemoteCallback<DataSet>() {
                    public void callback(DataSet result) {
                        if (result == null) {
                            listener.notFound();
                        } else {
                            listener.callback(result);
                        }
                    }
                },
                new ErrorCallback<Message>() {
                    @Override
                    public boolean error(Message message,
                                         Throwable throwable) {
                        return listener.onError(new ClientRuntimeError(throwable));
                    }
                })
                .lookupDataSet(request);
    } catch (Exception e) {
        listener.onError(new ClientRuntimeError(e));
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:DataSetClientServices.java

示例5: configureRepository

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
private void configureRepository() {
    assetManagementServices.call(new RemoteCallback<Long>() {
                                     @Override
                                     public void callback(Long taskId) {
                                         //view.displayNotification( "Repository Configuration Started!" );
                                     }
                                 },
                                 new ErrorCallback<Message>() {
                                     @Override
                                     public boolean error(Message message,
                                                          Throwable throwable) {
                                         ErrorPopup.showMessage("Unexpected error encountered : " + throwable.getMessage());
                                         return true;
                                     }
                                 }).configureRepository(projectContext.getActiveRepository().getAlias(),
                                                        projectContext.getActiveBranch(),
                                                        configureScreenPopupView.getDevBranch(),
                                                        configureScreenPopupView.getReleaseBranch(),
                                                        configureScreenPopupView.getVersion());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:RepositoryStructureMenu.java

示例6: configureRepository

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
public void configureRepository(String repository,
                                String sourceBranch,
                                String devBranch,
                                String releaseBranch,
                                String version) {
    assetManagementServices.call(new RemoteCallback<Long>() {
                                     @Override
                                     public void callback(Long taskId) {
                                         view.displayNotification("Repository Configuration Started!");
                                     }
                                 },
                                 new ErrorCallback<Message>() {
                                     @Override
                                     public boolean error(Message message,
                                                          Throwable throwable) {
                                         errorPopup.showMessage("Unexpected error encountered : " + throwable.getMessage());
                                         return true;
                                     }
                                 }
    ).configureRepository(repository,
                          sourceBranch,
                          devBranch,
                          releaseBranch,
                          version);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:RepositoryConfigurationPresenter.java

示例7: populateOrganizationalUnits

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
private void populateOrganizationalUnits() {
    //populate Organizational Units list box
    organizationalUnitService.call(new RemoteCallback<Collection<OrganizationalUnit>>() {
                                       @Override
                                       public void callback(final Collection<OrganizationalUnit> organizationalUnits) {
                                           view.addOrganizationalUnitSelectEntry();
                                           if (organizationalUnits != null && !organizationalUnits.isEmpty()) {
                                               for (OrganizationalUnit organizationalUnit : organizationalUnits) {
                                                   view.addOrganizationalUnit(organizationalUnit);
                                                   availableOrganizationalUnits.put(organizationalUnit.getName(),
                                                                                    organizationalUnit);
                                               }
                                           }
                                       }
                                   },
                                   new ErrorCallback<Message>() {
                                       @Override
                                       public boolean error(final Message message,
                                                            final Throwable throwable) {
                                           view.errorLoadOrganizationalUnitsFail(throwable);
                                           return false;
                                       }
                                   }).getOrganizationalUnits();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:CloneRepositoryPresenter.java

示例8: search

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
/**
 * Search the processes.
 * 
 * @param filters
 *            the filters
 * @param page
 *            the page
 * @param sortColumnId
 *            the sort column id
 * @param sortAscending
 *            the sort ascending
 * @param handler
 *            the handler
 */
public void search(ProcessesFilterBean filters, int page, String sortColumnId, boolean sortAscending,
        final IRpcServiceInvocationHandler<ProcessesResultSetBean> handler) {
    // TODO only allow one search at a time. If another search comes in
    // before the previous
    // one is finished, cancel the previous one. In other words, only return
    // the results of
    // the *last* search performed.
    RemoteCallback<ProcessesResultSetBean> successCallback = new DelegatingRemoteCallback<ProcessesResultSetBean>(handler);
    ErrorCallback<?> errorCallback = new DelegatingErrorCallback(handler);
    try {
        _remoteProcessService.call(successCallback, errorCallback).search(filters, page, sortColumnId, sortAscending);
    } catch (DtgovUiException e) {
        errorCallback.error(null, e);
    }
}
 
开发者ID:Governance,项目名称:dtgov,代码行数:30,代码来源:ProcessesRpcService.java

示例9: search

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
/**
 * Search.
 *
 * @param filters
 *            the filters
 * @param page
 *            the page
 * @param sortColumnId
 *            the sort column id
 * @param sortAscending
 *            the sort ascending
 * @param handler
 *            the handler
 * @see org.overlord.dtgov.ui.client.shared.services.IWorkflowQueryService#search(WorkflowQueriesFilterBean,int,String,boolean)
 */
public void search(WorkflowQueriesFilterBean filters, int page, String sortColumnId,
        boolean sortAscending, final IRpcServiceInvocationHandler<WorkflowQueryResultSetBean> handler) {
    // TODO only allow one search at a time. If another search comes in before the previous
    // one is finished, cancel the previous one. In other words, only return the results of
    // the *last* search performed.
    RemoteCallback<WorkflowQueryResultSetBean> successCallback = new DelegatingRemoteCallback<WorkflowQueryResultSetBean>(
            handler);
    ErrorCallback<?> errorCallback = new DelegatingErrorCallback(handler);
    try {
        _remoteWorkflowQueryService.call(successCallback, errorCallback).search(filters, page,
                sortColumnId, sortAscending);
    } catch (DtgovUiException e) {
        errorCallback.error(null, e);
    }
}
 
开发者ID:Governance,项目名称:dtgov,代码行数:31,代码来源:WorkflowQueriesRpcService.java

示例10: loadFromServer

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
private void loadFromServer() {

        view.showBusyIndicator( CommonConstants.INSTANCE.Loading() );

        dependencyService.call( new RemoteCallback<EnhancedDependencies>() {
                                    @Override
                                    public void callback( final EnhancedDependencies result ) {
                                        onLoadSuccess( result );
                                        view.hideBusyIndicator();
                                    }
                                },
                                new ErrorCallback<Object>() {
                                    @Override
                                    public boolean error( final Object o,
                                                          final Throwable throwable ) {


                                        returnDefault();
                                        view.hideBusyIndicator();
                                        return false;
                                    }
                                } ).loadEnhancedDependencies( updateQueue );
    }
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:24,代码来源:DependencyLoader.java

示例11: testAlreadyRunningBuild

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
@Test
public void testAlreadyRunningBuild() {
    when(buildService.call(any(RemoteCallback.class),
                           any(ErrorCallback.class))).thenAnswer(invocationOnMock -> {
        // not calling callback causes building is still set to true
        return buildServiceMock;
    });

    buildExecutor.triggerBuild();
    buildExecutor.triggerBuild();

    verify(view,
           times(1)).showABuildIsAlreadyRunning();
    verify(notificationEvent,
           never()).fire(any(NotificationEvent.class));
    verifyBusyShowHideAnyString(1,
                                0);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:19,代码来源:BuildExecutorTest.java

示例12: testAlreadyRunningBuildAndDeploy

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
@Test
public void testAlreadyRunningBuildAndDeploy() {
    when(buildService.call(any(RemoteCallback.class),
                           any(ErrorCallback.class))).thenAnswer(invocationOnMock -> {
        // not calling callback causes building is still set to true
        return buildServiceMock;
    });

    buildExecutor.triggerBuildAndDeploy();
    buildExecutor.triggerBuildAndDeploy();

    verify(view,
           times(1)).showABuildIsAlreadyRunning();
    verify(notificationEvent,
           never()).fire(any(NotificationEvent.class));
    verifyBusyShowHideAnyString(1,
                                0);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:19,代码来源:BuildExecutorTest.java

示例13: copyTemplate

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
public void copyTemplate() {
    copyPresenter.copy( new ParameterizedCommand<String>() {
        @Override
        public void execute( final String value ) {
            specManagementService.call( new RemoteCallback<Void>() {
                @Override
                public void callback( final Void aVoid ) {
                    copyPresenter.hide();
                    serverTemplateListRefreshEvent.fire( new ServerTemplateListRefresh( value ) );
                }
            }, new ErrorCallback<Object>() {
                @Override
                public boolean error( final Object o,
                                      final Throwable throwable ) {
                    copyPresenter.errorDuringProcessing( view.getCopyTemplateErrorMessage() );
                    return false;
                }
            } ).copyServerTemplate( serverTemplate.getId(), value, value );
        }
    } );
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:ServerTemplatePresenter.java

示例14: removeTemplate

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
public void removeTemplate() {
    view.confirmRemove( new Command() {
        @Override
        public void execute() {
            specManagementService.call( new RemoteCallback<Void>() {
                @Override
                public void callback( final Void aVoid ) {
                    serverTemplateListRefreshEvent.fire( new ServerTemplateListRefresh() );
                }
            }, new ErrorCallback<Object>() {
                @Override
                public boolean error( final Object o,
                                      final Throwable throwable ) {
                    notification.fire( new NotificationEvent( view.getRemoveTemplateErrorMessage(), NotificationEvent.NotificationType.ERROR ) );
                    serverTemplateListRefreshEvent.fire( new ServerTemplateListRefresh() );
                    return false;
                }
            } ).deleteServerTemplate( serverTemplate.getId() );
        }
    } );
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:ServerTemplatePresenter.java

示例15: removeContainer

import org.jboss.errai.common.client.api.ErrorCallback; //导入依赖的package包/类
public void removeContainer() {
    view.confirmRemove(new Command() {
        @Override
        public void execute() {
            specManagementService.call(new RemoteCallback<Void>() {
                                           @Override
                                           public void callback(final Void response) {
                                               notification.fire(new NotificationEvent(view.getRemoveContainerSuccessMessage(),
                                                                                       NotificationEvent.NotificationType.SUCCESS));
                                               serverTemplateSelectedEvent.fire(new ServerTemplateSelected(containerSpec.getServerTemplateKey()));
                                           }
                                       },
                                       new ErrorCallback<Object>() {
                                           @Override
                                           public boolean error(final Object o,
                                                                final Throwable throwable) {
                                               notification.fire(new NotificationEvent(view.getRemoveContainerErrorMessage(),
                                                                                       NotificationEvent.NotificationType.ERROR));
                                               serverTemplateSelectedEvent.fire(new ServerTemplateSelected(containerSpec.getServerTemplateKey()));
                                               return false;
                                           }
                                       }).deleteContainerSpec(containerSpec.getServerTemplateKey().getId(),
                                                              containerSpec.getId());
        }
    });
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:27,代码来源:ContainerPresenter.java


注:本文中的org.jboss.errai.common.client.api.ErrorCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。