Java 类org.glassfish.jersey.server.internal.LocalizationMessages 实例源码

项目:ameba    文件:ClassInfo.java   
/**
 * <p>getClassForName.</p>
 *
 * @param className a {@link java.lang.String} object.
 * @return a {@link java.lang.Class} object.
 */
public Class getClassForName(final String className) {
    try {
        final OsgiRegistry osgiRegistry = ReflectionHelper.getOsgiRegistryInstance();

        if (osgiRegistry != null) {
            return osgiRegistry.classForNameWithException(className);
        } else {
            return AccessController.doPrivileged(ReflectionHelper.classForNameWithExceptionPEA(className));
        }
    } catch (final ClassNotFoundException ex) {
        throw new RuntimeException(LocalizationMessages.ERROR_SCANNING_CLASS_NOT_FOUND(className), ex);
    } catch (final PrivilegedActionException pae) {
        final Throwable cause = pae.getCause();
        if (cause instanceof ClassNotFoundException) {
            throw new RuntimeException(LocalizationMessages.ERROR_SCANNING_CLASS_NOT_FOUND(className), cause);
        } else if (cause instanceof RuntimeException) {
            throw (RuntimeException) cause;
        } else {
            throw new RuntimeException(cause);
        }
    }
}
项目:rx-jersey    文件:RxMethodDispatcher.java   
/**
 * Uses {@link AsyncContext} to suspend current request
 *
 * @return obtained {@link AsyncContext} or throws error
 */
private AsyncContext suspend() {
    final AsyncContext context = asyncContext.get();

    if (!context.suspend()) {
        throw new ProcessingException(LocalizationMessages.ERROR_SUSPENDING_ASYNC_REQUEST());
    }

    return context;
}
项目:micro-server    文件:AsyncDispatcher.java   
@Override
public Response dispatch(Object resource, ContainerRequest request) throws ProcessingException {
    final AsyncContext context = this.asyncContext.get();
    if(!context.suspend())
        throw new ProcessingException(LocalizationMessages.ERROR_SUSPENDING_ASYNC_REQUEST());
    final ContainerRequestContext requestContext = containerRequestContext.get();

    Publisher pub = (Publisher)originalDispatcher.dispatch(resource, request)
                      .getEntity();
    Spouts.from(pub).onEmptySwitch(()->Spouts.of(Response.noContent().build()))
                .forEach(1,context::resume, context::resume);

    return null;
}
项目:ameba    文件:ParamConverters.java   
@Override
public Duration fromString(String value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }
    return Duration.parse(value);
}
项目:ameba    文件:ParamConverters.java   
@Override
public String toString(Duration value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }
    return value.toString();
}
项目:ameba    文件:ParamConverters.java   
@Override
public Period fromString(String value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }
    return Period.parse(value);
}
项目:ameba    文件:ParamConverters.java   
@Override
public String toString(Period value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }
    return value.toString();
}
项目:ameba    文件:ParamConverters.java   
@Override
public Instant fromString(String value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }
    return parseInstant(value);
}
项目:ameba    文件:ParamConverters.java   
@Override
public String toString(Instant value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }
    return value.toString();
}
项目:ameba    文件:ParamConverters.java   
@Override
public LocalDate fromString(String value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }

    return LocalDate.from(parseInstant(value));
}
项目:ameba    文件:ParamConverters.java   
@Override
public String toString(LocalDate value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }
    return value.toString();
}
项目:ameba    文件:ParamConverters.java   
@Override
public LocalDateTime fromString(String value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }
    return LocalDateTime.from(parseInstant(value));
}
项目:ameba    文件:ParamConverters.java   
@Override
public String toString(LocalDateTime value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }
    return value.toString();
}
项目:ameba    文件:ParamConverters.java   
@Override
public LocalTime fromString(String value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }
    return LocalTime.from(parseInstant(value));
}
项目:ameba    文件:ParamConverters.java   
@Override
public String toString(LocalTime value) {
    if (value == null) {
        throw new IllegalArgumentException(
                LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")
        );
    }
    return value.toString();
}
项目:Plume    文件:PermissionFeature.java   
@Override
public void filter(ContainerRequestContext requestContext) throws IOException {
    if(!authorize(requestContext, resourcePermission)) {
        throw new ForbiddenException(LocalizationMessages.USER_NOT_AUTHORIZED());
    }
}