本文整理汇总了Java中org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper类的典型用法代码示例。如果您正苦于以下问题:Java MarshallingWrapper类的具体用法?Java MarshallingWrapper怎么用?Java MarshallingWrapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MarshallingWrapper类属于org.jboss.errai.enterprise.client.jaxrs包,在下文中一共展示了MarshallingWrapper类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: received
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入依赖的package包/类
private void received(final String json) {
try {
LOGGER.finest("Receiving: " + json);
final Object o = MarshallingWrapper.fromJSON(json);
if (o instanceof WebWorkerLogMessage) {
LOGGER.info("Web Worker log message: " + ((WebWorkerLogMessage) o).getMessage());
} else if (o instanceof WebWorkerException) {
LOGGER.severe("Web Worker failed: " + ((WebWorkerException) o).getMessage());
} else if (o instanceof Status) {
reporter.sendStatus((Status) o);
} else if (o instanceof Issues) {
reporter.sendReport(new HashSet<>(((Issues) o).getSet()));
}
} catch (Exception e) {
LOGGER.severe("Could not manage received json: " + e.getMessage()
+ " JSON: " + json);
}
}
示例2: onResponseReceived
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void onResponseReceived(Request request, Response response) {
String result = response.getText();
List<R> responseObject = (List<R>) MarshallingWrapper.fromJSON(result, List.class, typeParameterClass);
if (responseObject != null) {
execute(responseObject);
}
}
示例3: onResponseReceived
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void onResponseReceived(Request request, Response response) {
String result = response.getText();
R responseObject = (R) MarshallingWrapper.fromJSON(result, typeParameterClass);
if (responseObject != null) {
execute(responseObject);
}
}
示例4: received
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入依赖的package包/类
public void received( final String json ) {
Object o = null;
try {
o = MarshallingWrapper.fromJSON( json );
} catch ( final Exception e ) {
error( "Failed to create and object out of the following JSON: " + json );
}
if ( o != null ) {
receiver.received( o );
}
}
示例5: postToMainApp
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入依赖的package包/类
private void postToMainApp( final Object o ) {
if ( !Logger.isEmpty() ) {
post( new WebWorkerLogMessage( Logger.log() ) );
}
postToMainApp( MarshallingWrapper.toJSON( o ) );
}
示例6: error
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入依赖的package包/类
@Override
public boolean error(Request message, Throwable throwable) {
try {
throw throwable;
} catch (ResponseException e) {
Response response = e.getResponse();
RestServiceException exception = MarshallingWrapper.fromJSON(response.getText(), RestServiceException.class);
exception(exception);
} catch (Throwable t) {
Window.alert(t.getMessage());
}
return false;
}
示例7: log
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入依赖的package包/类
public void log( final String message ) {
postToMainApp( MarshallingWrapper.toJSON( new WebWorkerLogMessage( message ) ) );
}
示例8: error
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入依赖的package包/类
public void error( final String message ) {
postToMainApp( MarshallingWrapper.toJSON( new WebWorkerException( message ) ) );
}
示例9: postObject
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入依赖的package包/类
private void postObject(final Object object) {
PortablePreconditions.checkNotNull("worker",
worker);
PortablePreconditions.checkNotNull("object",
object);
final String json = MarshallingWrapper.toJSON(object);
LOGGER.finest("Sending: " + json);
worker.postMessage(json);
}