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


Java MarshallingWrapper类代码示例

本文整理汇总了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);
        }
    }
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:23,代码来源:Receiver.java

示例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);
    }
}
 
开发者ID:baldram,项目名称:tristar-eye,代码行数:12,代码来源:RestRequestList.java

示例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);
    }
}
 
开发者ID:baldram,项目名称:tristar-eye,代码行数:11,代码来源:RestRequestSingle.java

示例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 );
        }
    }
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:15,代码来源:VerifierWebWorker.java

示例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 ) );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:8,代码来源:Poster.java

示例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;
}
 
开发者ID:lorislab,项目名称:smonitor,代码行数:14,代码来源:RestServiceExceptionCallback.java

示例7: log

import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入依赖的package包/类
public void log( final String message ) {
    postToMainApp( MarshallingWrapper.toJSON( new WebWorkerLogMessage( message ) ) );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:4,代码来源:VerifierWebWorker.java

示例8: error

import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入依赖的package包/类
public void error( final String message ) {
    postToMainApp( MarshallingWrapper.toJSON( new WebWorkerException( message ) ) );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:4,代码来源:VerifierWebWorker.java

示例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);
    }
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:14,代码来源:Poster.java


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