本文整理汇总了Java中org.jboss.errai.bus.client.api.messaging.Message类的典型用法代码示例。如果您正苦于以下问题:Java Message类的具体用法?Java Message怎么用?Java Message使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Message类属于org.jboss.errai.bus.client.api.messaging包,在下文中一共展示了Message类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendMessage
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的package包/类
private void sendMessage() {
final String messageText = messageTextBox.getText();
if ("".equals(messageText)) {
setStatus("message is mandatory");
messageTextBox.setFocus(true);
return;
}
setStatus("sending message from Errai Bus Client ...");
MessageBuilder.createMessage()
.toSubject("HelloWorldService")
.withValue(messageText)
.done()
.repliesTo(new MessageCallback() {
public void callback(Message message) {
setStatus("Response from server: " + message.get(String.class, MessageParts.Value));
}
})
.sendNowWith(messageBus);
}
示例2: getRenameErrorCallback
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的package包/类
private HasBusyIndicatorDefaultErrorCallback getRenameErrorCallback(final RenamePopUpPresenter.View renamePopupView,
BusyIndicatorView busyIndicatorView) {
return new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView) {
@Override
public boolean error(final Message message,
final Throwable throwable) {
if (fileAlreadyExists(throwable)) {
hideBusyIndicator();
renamePopupView.handleDuplicatedFileName();
return false;
}
renamePopupView.hide();
return super.error(message,
throwable);
}
};
}
示例3: getCopyErrorCallback
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的package包/类
public HasBusyIndicatorDefaultErrorCallback getCopyErrorCallback(final CopyPopUpPresenter.View copyPopupView,
BusyIndicatorView busyIndicatorView) {
return new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView) {
@Override
public boolean error(final Message message,
final Throwable throwable) {
if (fileAlreadyExists(throwable)) {
hideBusyIndicator();
copyPopupView.handleDuplicatedFileName();
return false;
}
copyPopupView.hide();
return super.error(message,
throwable);
}
};
}
示例4: acquireLock
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的package包/类
@Override
public void acquireLock(final Path path,
final ParameterizedCommand<LockResult> parameterizedCommand) {
vfsLockService.call(new RemoteCallback<LockResult>() {
@Override
public void callback(final LockResult result) {
parameterizedCommand.execute(result);
}
},
new BusErrorCallback() {
@Override
public boolean error(Message message,
Throwable throwable) {
logger.error("Error when trying to acquire lock for " + path.toURI(),
throwable);
parameterizedCommand.execute(LockResult.error());
return false;
}
}).acquireLock(path);
}
示例5: _lookupDataSet
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的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));
}
}
示例6: configureRepository
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的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());
}
示例7: configureRepository
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的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);
}
示例8: populateOrganizationalUnits
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的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();
}
示例9: testRunScenarioFail
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的package包/类
@Test
public void testRunScenarioFail() throws Exception {
final TestRunFailedErrorCallback callback = mock(TestRunFailedErrorCallback.class);
doReturn(true)
.when(callback)
.error(any(Message.class),
any(RuntimeException.class));
doReturn(callback).when(editor).getTestRunFailedCallback();
doThrow(new RuntimeException("some problem")).when(service).runScenario(anyString(),
any(Path.class),
any(Scenario.class));
editor.onRunScenario();
verify(callback).error(any(Message.class),
any(RuntimeException.class));
verify(view).showBusyIndicator(TestScenarioConstants.INSTANCE.BuildingAndRunningScenario());
}
示例10: testRunAllScenariosFail
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的package包/类
@Test
public void testRunAllScenariosFail() throws Exception {
final TestRunFailedErrorCallback callback = mock(TestRunFailedErrorCallback.class);
doReturn(true)
.when(callback)
.error(any(Message.class),
any(RuntimeException.class));
doReturn(callback).when(editor).getTestRunFailedCallback();
doThrow(new RuntimeException("some problem")).when(testService).runAllTests(anyString(),
any(Path.class));
editor.onRunAllScenarios();
verify(callback).error(any(Message.class),
any(RuntimeException.class));
verify(view).showBusyIndicator(TestScenarioConstants.INSTANCE.BuildingAndRunningScenarios());
}
示例11: search
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的package包/类
private void search( String dataSource,
String schema,
String databaseObjectType,
String searchTerm,
InitializeCallback initializeCallback ) {
clear( );
view.showBusyIndicator( translationService.getTranslation(
DataSourceManagementConstants.DatabaseObjectExplorerViewImpl_loadingDbObjects ) );
metadataService.call( getSearchSuccessCallback( initializeCallback ),
new HasBusyIndicatorDefaultErrorCallback( view ) {
@Override
public boolean error( Message message, Throwable throwable ) {
boolean result = super.error( message, throwable );
if ( initializeCallback != null ) {
initializeCallback.onInitializeError( throwable );
}
return result;
}
} ).findTables( dataSource,
schema, buildSearchTerm( searchTerm ), buildSearchType( view.getObjectType() ) );
}
示例12: loadSchemas
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的package包/类
private void loadSchemas( String dataSourceUuid, InitializeCallback initializeCallback ) {
clear( );
view.showBusyIndicator( translationService.getTranslation(
DataSourceManagementConstants.DatabaseSchemaExplorerViewImpl_loadingDbSchemas ) );
metadataService.call( new RemoteCallback< DatabaseMetadata >( ) {
@Override
public void callback( DatabaseMetadata metadata ) {
view.hideBusyIndicator( );
loadSchemas( metadata.getSchemas( ) );
if ( initializeCallback != null ) {
initializeCallback.onInitializeSuccess( );
}
}
}, new HasBusyIndicatorDefaultErrorCallback( view ) {
@Override
public boolean error( Message message, Throwable throwable ) {
boolean result = super.error( message, throwable );
if ( initializeCallback != null ) {
initializeCallback.onInitializeError( throwable );
}
return result;
}
} ).getMetadata( dataSourceUuid, false, true );
}
示例13: importRepository
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的package包/类
public void importRepository() {
final String repositoryUrl = view.getRepositoryURL();
if (isEmpty(repositoryUrl)) {
view.showError(view.getEmptyRepositoryURLValidationMessage());
return;
}
view.showBusyIndicator(view.getLoadingMessage());
libraryService.call((Set<ExampleProject> projects) -> {
view.hideBusyIndicator();
view.hide();
libraryPlaces.goToImportProjects(null);
importProjectsSetupEvent.fire(new ImportProjectsSetupEvent(projects));
},
new DefaultErrorCallback() {
@Override
public boolean error(final Message message,
final Throwable throwable) {
view.hideBusyIndicator();
view.showError(view.getNoProjectsToImportMessage());
return false;
}
}).getProjects(repositoryUrl,
view.getUserName(),
view.getPassword());
}
示例14: verifyShowHide
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的package包/类
private void verifyShowHide(boolean positive) {
when(serviceCaller.call(any(RemoteCallback.class),
any(ErrorCallback.class)))
.thenAnswer(new LoadContentAnswer(importsService,
importsContent,
positive ? null : errorCallback));
presenter.init(path,
placeRequest);
verify(view).showLoading();
if (positive) {
verify(view).hideBusyIndicator();
} else {
verify(errorCallback).error(any(Message.class),
any(Throwable.class));
}
}
示例15: getDataTypes
import org.jboss.errai.bus.client.api.messaging.Message; //导入依赖的package包/类
protected void getDataTypes() {
final String simpleDataTypes = "Boolean:Boolean,Float:Float,Integer:Integer,Object:Object,String:String";
MessageBuilder.createCall(
new RemoteCallback<List<String>>() {
public void callback(List<String> dataTypes) {
String formattedDataTypes = formatDataTypes(dataTypes);
String allDataTypes = simpleDataTypes + "," + formattedDataTypes;
showDataIOEditor(allDataTypes.toString());
}
},
new BusErrorCallback() {
public boolean error(Message message,
Throwable t) {
notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.INSTANCE.Error_retrieving_datatypes(),
NotificationEvent.NotificationType.ERROR));
showDataIOEditor(simpleDataTypes);
return false;
}
},
DataTypesService.class).getDataTypeNames();
}